aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-12-12 00:50:59 +0800
committerchriseth <c@ethdev.com>2016-12-12 00:57:15 +0800
commit4184525d4ad7aff3acb2d521c3cdc21054e36eff (patch)
tree796aa1b3ba7d64ed89d276a018074dafc1a1b454 /libsolidity
parentefd7b4bfbb5fef99bcf4ee7c98c2ade4c1467f87 (diff)
downloaddexon-solidity-4184525d4ad7aff3acb2d521c3cdc21054e36eff.tar
dexon-solidity-4184525d4ad7aff3acb2d521c3cdc21054e36eff.tar.gz
dexon-solidity-4184525d4ad7aff3acb2d521c3cdc21054e36eff.tar.bz2
dexon-solidity-4184525d4ad7aff3acb2d521c3cdc21054e36eff.tar.lz
dexon-solidity-4184525d4ad7aff3acb2d521c3cdc21054e36eff.tar.xz
dexon-solidity-4184525d4ad7aff3acb2d521c3cdc21054e36eff.tar.zst
dexon-solidity-4184525d4ad7aff3acb2d521c3cdc21054e36eff.zip
Fix inline assembly.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/codegen/CompilerContext.cpp3
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(