Skip to content

Commit d4f53e1

Browse files
committed
Fix try-catch parsing
1 parent 7dcefcc commit d4f53e1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

slither/solc_parsing/declarations/function.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,9 @@ def _fix_catch(self, node: Node, end_node: Node, visited: Set[Node]) -> None:
12881288
link_nodes(node, end_node)
12891289
else:
12901290
for son in node.sons:
1291-
if son != end_node and son not in visited:
1291+
# If the son is a TRY node it will be fixed later when _fix_try is called with that node
1292+
# otherwise we try to fix it multiple times. It can happen in the case of nested try-catch blocks.
1293+
if son != end_node and son not in visited and son.type != NodeType.TRY:
12921294
visited.add(son)
12931295
self._fix_catch(son, end_node, visited)
12941296

0 commit comments

Comments
 (0)