aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/inlineasm/AsmAnalysis.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-03-23 02:02:27 +0800
committerchriseth <chris@ethereum.org>2017-04-25 22:49:03 +0800
commit83bf34c571023cb264c56b3bd791a6fd9ebc3bf2 (patch)
treed53c3fe163612ef162a2b474b9e6f21fe1576112 /libsolidity/inlineasm/AsmAnalysis.cpp
parent3f1f0316c686f46600f3ab9ed4c65cda9bcc8a58 (diff)
downloaddexon-solidity-83bf34c571023cb264c56b3bd791a6fd9ebc3bf2.tar
dexon-solidity-83bf34c571023cb264c56b3bd791a6fd9ebc3bf2.tar.gz
dexon-solidity-83bf34c571023cb264c56b3bd791a6fd9ebc3bf2.tar.bz2
dexon-solidity-83bf34c571023cb264c56b3bd791a6fd9ebc3bf2.tar.lz
dexon-solidity-83bf34c571023cb264c56b3bd791a6fd9ebc3bf2.tar.xz
dexon-solidity-83bf34c571023cb264c56b3bd791a6fd9ebc3bf2.tar.zst
dexon-solidity-83bf34c571023cb264c56b3bd791a6fd9ebc3bf2.zip
Review comments and cleanup.
Diffstat (limited to 'libsolidity/inlineasm/AsmAnalysis.cpp')
-rw-r--r--libsolidity/inlineasm/AsmAnalysis.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp
index e989560d..53f48819 100644
--- a/libsolidity/inlineasm/AsmAnalysis.cpp
+++ b/libsolidity/inlineasm/AsmAnalysis.cpp
@@ -246,7 +246,7 @@ bool AsmAnalyzer::operator()(assembly::FunctionCall const& _funCall)
if (!expectDeposit(1, stackHeight, locationOf(arg)))
success = false;
}
- m_stackHeight += returns - arguments;
+ m_stackHeight += int(returns) - int(arguments);
return success;
}
@@ -255,9 +255,8 @@ bool AsmAnalyzer::operator()(Block const& _block)
bool success = true;
m_currentScope = &scope(&_block);
- int const virtualVariablesInNextBlock = m_virtualVariablesInNextBlock;
+ int const initialStackHeight = m_stackHeight - m_virtualVariablesInNextBlock;
m_virtualVariablesInNextBlock = 0;
- int const initialStackHeight = m_stackHeight;
for (auto const& s: _block.statements)
if (!boost::apply_visitor(*this, s))
@@ -267,7 +266,7 @@ bool AsmAnalyzer::operator()(Block const& _block)
if (identifier.second.type() == typeid(Scope::Variable))
--m_stackHeight;
- int const stackDiff = m_stackHeight - initialStackHeight + virtualVariablesInNextBlock;
+ int const stackDiff = m_stackHeight - initialStackHeight;
if (stackDiff != 0)
{
m_errors.push_back(make_shared<Error>(