diff options
author | Leonardo Alt <leo@ethereum.org> | 2018-07-04 20:14:41 +0800 |
---|---|---|
committer | Leonardo Alt <leo@ethereum.org> | 2018-07-11 00:39:38 +0800 |
commit | 9d895e002d0e5e1e3435d03ac82277caa397bbec (patch) | |
tree | 5931b89c3ae65d6bc2c5647d82ade808f5676abb /libsolidity/codegen/CompilerUtils.cpp | |
parent | 1f77deada1abc9ca1e635ab13d45707e852a5628 (diff) | |
download | dexon-solidity-9d895e002d0e5e1e3435d03ac82277caa397bbec.tar.gz dexon-solidity-9d895e002d0e5e1e3435d03ac82277caa397bbec.tar.zst dexon-solidity-9d895e002d0e5e1e3435d03ac82277caa397bbec.zip |
Added tests and review suggestions
Diffstat (limited to 'libsolidity/codegen/CompilerUtils.cpp')
-rw-r--r-- | libsolidity/codegen/CompilerUtils.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libsolidity/codegen/CompilerUtils.cpp b/libsolidity/codegen/CompilerUtils.cpp index 2f45765a..92c45227 100644 --- a/libsolidity/codegen/CompilerUtils.cpp +++ b/libsolidity/codegen/CompilerUtils.cpp @@ -1170,6 +1170,14 @@ void CompilerUtils::popStackSlots(size_t _amount) m_context << Instruction::POP; } +void CompilerUtils::popAndJump(unsigned _toHeight, eth::AssemblyItem const& _jumpTo) +{ + unsigned amount = m_context.stackHeight() - _toHeight; + popStackSlots(amount); + m_context.appendJumpTo(_jumpTo); + m_context.adjustStackOffset(amount); +} + unsigned CompilerUtils::sizeOnStack(vector<shared_ptr<Type const>> const& _variableTypes) { unsigned size = 0; |