aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/CompilerUtils.cpp
diff options
context:
space:
mode:
authorLeonardo Alt <leo@ethereum.org>2018-07-04 20:14:41 +0800
committerLeonardo Alt <leo@ethereum.org>2018-07-11 00:39:38 +0800
commit9d895e002d0e5e1e3435d03ac82277caa397bbec (patch)
tree5931b89c3ae65d6bc2c5647d82ade808f5676abb /libsolidity/codegen/CompilerUtils.cpp
parent1f77deada1abc9ca1e635ab13d45707e852a5628 (diff)
downloaddexon-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.cpp8
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;