From d7ebe32361df47f82a59ec2e7f2444f4ef21a800 Mon Sep 17 00:00:00 2001 From: Josselin Date: Mon, 7 Jan 2019 13:12:44 +0000 Subject: [PATCH] Loop parsing: expression -> condition, rather than expression -> begin loop --- slither/solc_parsing/declarations/function.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/slither/solc_parsing/declarations/function.py b/slither/solc_parsing/declarations/function.py index 424ffd96e..9ebe7ca1d 100644 --- a/slither/solc_parsing/declarations/function.py +++ b/slither/solc_parsing/declarations/function.py @@ -191,9 +191,9 @@ class FunctionSolc(Function): if loop_expression: node_LoopExpression = self._parse_statement(loop_expression, node_body) - link_nodes(node_LoopExpression, node_startLoop) + link_nodes(node_LoopExpression, node_condition) else: - link_nodes(node_body, node_startLoop) + link_nodes(node_body, node_condition) if not condition: if not loop_expression: @@ -286,7 +286,7 @@ class FunctionSolc(Function): if not hasCondition and not hasLoopExpression: link_nodes(node, node_endLoop) - link_nodes(node_LoopExpression, node_startLoop) + link_nodes(node_LoopExpression, node_condition) return node_endLoop