From fefd3b866d982d95d05e5956d1af48b357162cc8 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 31 May 2017 12:15:43 +0200 Subject: Introduce machine-dependent stack adjustment. --- libsolidity/inlineasm/AsmAnalysis.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libsolidity/inlineasm/AsmAnalysis.cpp') 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; } -- cgit