diff options
author | chriseth <chris@ethereum.org> | 2017-05-22 18:32:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-22 18:32:22 +0800 |
commit | e3af064098edae79aa3bbfb2a96b43fa3479269d (patch) | |
tree | ad8079a0032ee8fe4a9cf6a90f898c03a07619cc /libsolidity/codegen/CompilerContext.cpp | |
parent | 1344f28fdc96276285a009df369e02555141fc27 (diff) | |
parent | 7f5601fd4b63e90313f1a9c1a53e08ba9757b452 (diff) | |
download | dexon-solidity-e3af064098edae79aa3bbfb2a96b43fa3479269d.tar dexon-solidity-e3af064098edae79aa3bbfb2a96b43fa3479269d.tar.gz dexon-solidity-e3af064098edae79aa3bbfb2a96b43fa3479269d.tar.bz2 dexon-solidity-e3af064098edae79aa3bbfb2a96b43fa3479269d.tar.lz dexon-solidity-e3af064098edae79aa3bbfb2a96b43fa3479269d.tar.xz dexon-solidity-e3af064098edae79aa3bbfb2a96b43fa3479269d.tar.zst dexon-solidity-e3af064098edae79aa3bbfb2a96b43fa3479269d.zip |
Merge pull request #2197 from ethereum/evm15
Refactoring to support multiple EVM-like backends
Diffstat (limited to 'libsolidity/codegen/CompilerContext.cpp')
-rw-r--r-- | libsolidity/codegen/CompilerContext.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libsolidity/codegen/CompilerContext.cpp b/libsolidity/codegen/CompilerContext.cpp index 51dd9fd2..5c4f88c4 100644 --- a/libsolidity/codegen/CompilerContext.cpp +++ b/libsolidity/codegen/CompilerContext.cpp @@ -264,7 +264,7 @@ void CompilerContext::appendInlineAssembly( assembly = &replacedAssembly; } - unsigned startStackHeight = stackHeight(); + int startStackHeight = stackHeight(); assembly::ExternalIdentifierAccess identifierAccess; identifierAccess.resolve = [&]( @@ -278,26 +278,26 @@ void CompilerContext::appendInlineAssembly( identifierAccess.generateCode = [&]( assembly::Identifier const& _identifier, assembly::IdentifierContext _context, - eth::Assembly& _assembly + julia::AbstractAssembly& _assembly ) { auto it = std::find(_localVariables.begin(), _localVariables.end(), _identifier.name); solAssert(it != _localVariables.end(), ""); - unsigned stackDepth = _localVariables.end() - it; - int stackDiff = _assembly.deposit() - startStackHeight + stackDepth; + int stackDepth = _localVariables.end() - it; + int stackDiff = _assembly.stackHeight() - startStackHeight + stackDepth; if (_context == assembly::IdentifierContext::LValue) stackDiff -= 1; if (stackDiff < 1 || stackDiff > 16) BOOST_THROW_EXCEPTION( CompilerError() << - errinfo_comment("Stack too deep, try removing local variables.") + errinfo_comment("Stack too deep (" + to_string(stackDiff) + "), try removing local variables.") ); if (_context == assembly::IdentifierContext::RValue) - _assembly.append(dupInstruction(stackDiff)); + _assembly.appendInstruction(dupInstruction(stackDiff)); else { - _assembly.append(swapInstruction(stackDiff)); - _assembly.append(Instruction::POP); + _assembly.appendInstruction(swapInstruction(stackDiff)); + _assembly.appendInstruction(Instruction::POP); } }; |