aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-05-31 18:15:43 +0800
committerchriseth <chris@ethereum.org>2017-06-08 21:52:45 +0800
commitfefd3b866d982d95d05e5956d1af48b357162cc8 (patch)
treee5d9cd9a778fe5c3f0723a3b07cd4b400c4ffc46 /libsolidity
parent64ddb176bb71498f3a129e0cc549797f4138ec1f (diff)
downloaddexon-solidity-fefd3b866d982d95d05e5956d1af48b357162cc8.tar
dexon-solidity-fefd3b866d982d95d05e5956d1af48b357162cc8.tar.gz
dexon-solidity-fefd3b866d982d95d05e5956d1af48b357162cc8.tar.bz2
dexon-solidity-fefd3b866d982d95d05e5956d1af48b357162cc8.tar.lz
dexon-solidity-fefd3b866d982d95d05e5956d1af48b357162cc8.tar.xz
dexon-solidity-fefd3b866d982d95d05e5956d1af48b357162cc8.tar.zst
dexon-solidity-fefd3b866d982d95d05e5956d1af48b357162cc8.zip
Introduce machine-dependent stack adjustment.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/inlineasm/AsmAnalysis.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp
index b59a8527..bfc6b2af 100644
--- a/libsolidity/inlineasm/AsmAnalysis.cpp
+++ b/libsolidity/inlineasm/AsmAnalysis.cpp
@@ -203,8 +203,7 @@ bool AsmAnalyzer::operator()(assembly::FunctionDefinition const& _funDef)
}
int const stackHeight = m_stackHeight;
- // 1 for return label, depends on VM version
- m_stackHeight = 1 + _funDef.arguments.size() + _funDef.returns.size();
+ m_stackHeight = _funDef.arguments.size() + _funDef.returns.size();
bool success = (*this)(_funDef.body);
@@ -258,11 +257,10 @@ bool AsmAnalyzer::operator()(assembly::FunctionCall const& _funCall)
success = false;
}
}
- m_stackHeight += 1; // Return label, but depends on backend
for (auto const& arg: _funCall.arguments | boost::adaptors::reversed)
if (!expectExpression(arg))
success = false;
- m_stackHeight += int(returns) - int(arguments) - 1; // Return label, but depends on backend
+ m_stackHeight += int(returns) - int(arguments);
m_info.stackHeightInfo[&_funCall] = m_stackHeight;
return success;
}