aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-05-15 20:19:40 +0800
committerchriseth <chris@ethereum.org>2018-05-17 00:32:48 +0800
commit1cbc037a45b7aaab20a61750a196f956e9962eb7 (patch)
tree22d81baf4fcb7f24f356b037a2c57fb69cd0bf18 /libsolidity
parentf627dc77d01a9367b41d4a2e1654f045f9e4264a (diff)
downloaddexon-solidity-1cbc037a45b7aaab20a61750a196f956e9962eb7.tar.gz
dexon-solidity-1cbc037a45b7aaab20a61750a196f956e9962eb7.tar.zst
dexon-solidity-1cbc037a45b7aaab20a61750a196f956e9962eb7.zip
Update control flow graph.
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/ControlFlowBuilder.cpp9
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);