Fix empty do-while loop parsing (close #133)

pull/132/head
Josselin 6 years ago
parent 05556c932b
commit 889edd2952
  1. 4
      slither/solc_parsing/declarations/function.py

@ -313,6 +313,10 @@ class FunctionSolc(Function):
node_endDoWhile = self._new_node(NodeType.ENDLOOP, doWhilestatement['src'])
link_nodes(node, node_startDoWhile)
# empty block, loop from the start to the condition
if not node_condition.sons:
link_nodes(node_startDoWhile, node_condition)
else:
link_nodes(node_startDoWhile, node_condition.sons[0])
link_nodes(statement, node_condition)
link_nodes(node_condition, node_endDoWhile)

Loading…
Cancel
Save