diff options
author | chriseth <chris@ethereum.org> | 2017-12-08 21:01:22 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-12-13 19:28:15 +0800 |
commit | 54b6739962ef45319777ce2aebafdf4b91412d84 (patch) | |
tree | d15c289ebb4e57b16678b93e223bc477e9093b6c /libsolidity/inlineasm/AsmAnalysis.cpp | |
parent | 7614b16dc9b2bb1e267e8f46834b40220fb9f9fb (diff) | |
download | dexon-solidity-54b6739962ef45319777ce2aebafdf4b91412d84.tar dexon-solidity-54b6739962ef45319777ce2aebafdf4b91412d84.tar.gz dexon-solidity-54b6739962ef45319777ce2aebafdf4b91412d84.tar.bz2 dexon-solidity-54b6739962ef45319777ce2aebafdf4b91412d84.tar.lz dexon-solidity-54b6739962ef45319777ce2aebafdf4b91412d84.tar.xz dexon-solidity-54b6739962ef45319777ce2aebafdf4b91412d84.tar.zst dexon-solidity-54b6739962ef45319777ce2aebafdf4b91412d84.zip |
Separate expression and statement.
Diffstat (limited to 'libsolidity/inlineasm/AsmAnalysis.cpp')
-rw-r--r-- | libsolidity/inlineasm/AsmAnalysis.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp index 049af65f..17b7cce0 100644 --- a/libsolidity/inlineasm/AsmAnalysis.cpp +++ b/libsolidity/inlineasm/AsmAnalysis.cpp @@ -155,6 +155,16 @@ bool AsmAnalyzer::operator()(FunctionalInstruction const& _instr) return success; } +bool AsmAnalyzer::operator()(assembly::ExpressionStatement const& _statement) +{ +// size_t initialStackHeight = m_stackHeight; + bool success = boost::apply_visitor(*this, _statement.expression); +// if (!expectDeposit(0, initialStackHeight, _statement.location)) +// success = false; + m_info.stackHeightInfo[&_statement] = m_stackHeight; + return success; +} + bool AsmAnalyzer::operator()(assembly::StackAssignment const& _assignment) { solAssert(!m_julia, ""); @@ -407,13 +417,13 @@ bool AsmAnalyzer::operator()(Block const& _block) return success; } -bool AsmAnalyzer::expectExpression(Statement const& _statement) +bool AsmAnalyzer::expectExpression(Expression const& _expr) { bool success = true; int const initialHeight = m_stackHeight; - if (!boost::apply_visitor(*this, _statement)) + if (!boost::apply_visitor(*this, _expr)) success = false; - if (!expectDeposit(1, initialHeight, locationOf(_statement))) + if (!expectDeposit(1, initialHeight, locationOf(_expr))) success = false; return success; } |