diff options
author | chriseth <chris@ethereum.org> | 2018-05-24 00:11:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-24 00:11:20 +0800 |
commit | 5ee2ce353edfddbf925e775b321247246d150593 (patch) | |
tree | 5803f4c77e989f9b778d3702e82cdcfc8a897e0a /libsolidity/analysis/ControlFlowBuilder.cpp | |
parent | 6d08341942763730ba19c882520a4f45bb350b20 (diff) | |
parent | 87a838583290d66f4d4d78149a6d7398a41750ec (diff) | |
download | dexon-solidity-5ee2ce353edfddbf925e775b321247246d150593.tar dexon-solidity-5ee2ce353edfddbf925e775b321247246d150593.tar.gz dexon-solidity-5ee2ce353edfddbf925e775b321247246d150593.tar.bz2 dexon-solidity-5ee2ce353edfddbf925e775b321247246d150593.tar.lz dexon-solidity-5ee2ce353edfddbf925e775b321247246d150593.tar.xz dexon-solidity-5ee2ce353edfddbf925e775b321247246d150593.tar.zst dexon-solidity-5ee2ce353edfddbf925e775b321247246d150593.zip |
Merge pull request #4067 from ethereum/050
[BREAKING] Version 0.5.0
Diffstat (limited to 'libsolidity/analysis/ControlFlowBuilder.cpp')
-rw-r--r-- | libsolidity/analysis/ControlFlowBuilder.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libsolidity/analysis/ControlFlowBuilder.cpp b/libsolidity/analysis/ControlFlowBuilder.cpp index 35d7687c..5bd39da3 100644 --- a/libsolidity/analysis/ControlFlowBuilder.cpp +++ b/libsolidity/analysis/ControlFlowBuilder.cpp @@ -159,15 +159,14 @@ bool ControlFlowBuilder::visit(WhileStatement const& _whileStatement) { auto afterWhile = newLabel(); auto whileBody = createLabelHere(); + auto condition = newLabel(); { - // Note that "continue" in this case currently indeed jumps to whileBody - // and not to the condition. This is inconsistent with JavaScript and C and - // therefore a bug. This will be fixed in the future (planned for 0.5.0) - // and the Control Flow Graph will have to be adjusted accordingly. - BreakContinueScope scope(*this, afterWhile, whileBody); + BreakContinueScope scope(*this, afterWhile, condition); appendControlFlow(_whileStatement.body()); } + + placeAndConnectLabel(condition); appendControlFlow(_whileStatement.condition()); connect(m_currentNode, whileBody); |