diff options
author | chriseth <c@ethdev.com> | 2016-12-12 00:50:59 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-12-12 00:57:15 +0800 |
commit | 4184525d4ad7aff3acb2d521c3cdc21054e36eff (patch) | |
tree | 796aa1b3ba7d64ed89d276a018074dafc1a1b454 /libsolidity | |
parent | efd7b4bfbb5fef99bcf4ee7c98c2ade4c1467f87 (diff) | |
download | dexon-solidity-4184525d4ad7aff3acb2d521c3cdc21054e36eff.tar.gz dexon-solidity-4184525d4ad7aff3acb2d521c3cdc21054e36eff.tar.zst dexon-solidity-4184525d4ad7aff3acb2d521c3cdc21054e36eff.zip |
Fix inline assembly.
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/codegen/CompilerContext.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libsolidity/codegen/CompilerContext.cpp b/libsolidity/codegen/CompilerContext.cpp index 59750504..c14ab845 100644 --- a/libsolidity/codegen/CompilerContext.cpp +++ b/libsolidity/codegen/CompilerContext.cpp @@ -202,6 +202,8 @@ void CompilerContext::appendInlineAssembly( return false; unsigned stackDepth = _localVariables.end() - it; int stackDiff = _assembly.deposit() - startStackHeight + stackDepth; + if (_context == assembly::CodeGenerator::IdentifierContext::LValue) + stackDiff -= 1; if (stackDiff < 1 || stackDiff > 16) BOOST_THROW_EXCEPTION( CompilerError() << @@ -218,7 +220,6 @@ void CompilerContext::appendInlineAssembly( }; solAssert(assembly::InlineAssemblyStack().parseAndAssemble(*assembly, *m_asm, identifierAccess), "Failed to assemble inline assembly block."); - setStackOffset(startStackHeight); } FunctionDefinition const& CompilerContext::resolveVirtualFunction( |