compact ast: Fix incorrect Return Statement parsing

pull/54/head
Josselin 6 years ago
parent 9a1fd8d1cd
commit f44fda030a
  1. 4
      slither/solc_parsing/declarations/function.py

@ -540,6 +540,10 @@ class FunctionSolc(Function):
elif name == 'Return':
return_node = self._new_node(NodeType.RETURN)
link_nodes(node, return_node)
if self.is_compact_ast:
if statement['expression']:
return_node.add_unparsed_expression(statement['expression'])
else:
if self.get_children('children') in statement and statement[self.get_children('children')]:
assert len(statement[self.get_children('children')]) == 1
expression = statement[self.get_children('children')][0]

Loading…
Cancel
Save