diff options
author | chriseth <c@ethdev.com> | 2015-05-04 16:16:10 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-05-04 16:54:50 +0800 |
commit | ef26d9611120c5d3c36263a87e907a007e24c8d2 (patch) | |
tree | 6b408a3d9bc8150cf3dd61299bcd5caeee15a0dd | |
parent | 8a1758e60501911b44a0287c4573d4316b684295 (diff) | |
download | dexon-solidity-ef26d9611120c5d3c36263a87e907a007e24c8d2.tar dexon-solidity-ef26d9611120c5d3c36263a87e907a007e24c8d2.tar.gz dexon-solidity-ef26d9611120c5d3c36263a87e907a007e24c8d2.tar.bz2 dexon-solidity-ef26d9611120c5d3c36263a87e907a007e24c8d2.tar.lz dexon-solidity-ef26d9611120c5d3c36263a87e907a007e24c8d2.tar.xz dexon-solidity-ef26d9611120c5d3c36263a87e907a007e24c8d2.tar.zst dexon-solidity-ef26d9611120c5d3c36263a87e907a007e24c8d2.zip |
Fix for broken continue in for loop.
Fixes #1789.
-rw-r--r-- | Compiler.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Compiler.cpp b/Compiler.cpp index 37b577cc..d57f30c1 100644 --- a/Compiler.cpp +++ b/Compiler.cpp @@ -431,7 +431,8 @@ bool Compiler::visit(ForStatement const& _forStatement) CompilerContext::LocationSetter locationSetter(m_context, _forStatement); eth::AssemblyItem loopStart = m_context.newTag(); eth::AssemblyItem loopEnd = m_context.newTag(); - m_continueTags.push_back(loopStart); + eth::AssemblyItem loopNext = m_context.newTag(); + m_continueTags.push_back(loopNext); m_breakTags.push_back(loopEnd); if (_forStatement.getInitializationExpression()) @@ -449,6 +450,8 @@ bool Compiler::visit(ForStatement const& _forStatement) _forStatement.getBody().accept(*this); + m_context << loopNext; + // for's loop expression if existing if (_forStatement.getLoopExpression()) _forStatement.getLoopExpression()->accept(*this); |