From 6de9eedbd1bb69b63fc36f081dfbc86ec99b4ef5 Mon Sep 17 00:00:00 2001 From: Josselin Date: Thu, 25 Oct 2018 08:59:44 +0100 Subject: [PATCH] Partial fix on loop break recovery --- slither/solc_parsing/declarations/function.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/slither/solc_parsing/declarations/function.py b/slither/solc_parsing/declarations/function.py index 0b9b5d935..273332511 100644 --- a/slither/solc_parsing/declarations/function.py +++ b/slither/solc_parsing/declarations/function.py @@ -216,6 +216,13 @@ class FunctionSolc(Function): else: link_nodes(node_body, node_startLoop) + if not condition: + if not loop_expression: + # TODO: fix case where loop has no expression + link_nodes(node_startLoop, node_endLoop) + else: + link_nodes(node_LoopExpression, node_endLoop) + return node_endLoop