aboutsummaryrefslogtreecommitdiffstats
path: root/libjulia/backends/evm/EVMCodeTransform.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-01 21:47:11 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-06-16 17:56:21 +0800
commit78b49db779376b8ddedc0abb91a82a3384def4f1 (patch)
tree38aa28acbdf1e7c072a3fe301c8d7b06a105be50 /libjulia/backends/evm/EVMCodeTransform.cpp
parent8e5c4bf21dfd9cfaa8de35aef034bb32be290a48 (diff)
downloaddexon-solidity-78b49db779376b8ddedc0abb91a82a3384def4f1.tar.gz
dexon-solidity-78b49db779376b8ddedc0abb91a82a3384def4f1.tar.zst
dexon-solidity-78b49db779376b8ddedc0abb91a82a3384def4f1.zip
Helper to count the number of variables in a scope.
Diffstat (limited to 'libjulia/backends/evm/EVMCodeTransform.cpp')
-rw-r--r--libjulia/backends/evm/EVMCodeTransform.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/libjulia/backends/evm/EVMCodeTransform.cpp b/libjulia/backends/evm/EVMCodeTransform.cpp
index 00d0bde5..64e13f94 100644
--- a/libjulia/backends/evm/EVMCodeTransform.cpp
+++ b/libjulia/backends/evm/EVMCodeTransform.cpp
@@ -43,9 +43,8 @@ void CodeTransform::run(Block const& _block)
m_assembly.setSourceLocation(_block.location);
// pop variables
- for (auto const& identifier: m_scope->identifiers)
- if (identifier.second.type() == typeid(Scope::Variable))
- m_assembly.appendInstruction(solidity::Instruction::POP);
+ for (size_t i = 0; i < m_scope->numberOfVariables(); ++i)
+ m_assembly.appendInstruction(solidity::Instruction::POP);
int deposit = m_assembly.stackHeight() - blockStartStackHeight;
solAssert(deposit == 0, "Invalid stack height at end of block.");