Skip to content

Commit

Permalink
Fix/iterative update (#2206)
Browse files Browse the repository at this point in the history
* use iterative algo to prevent exceeding recursion limit

* proper fixpoint
  • Loading branch information
0xalpharush authored Jan 29, 2024
1 parent b292175 commit 28a921e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions slither/solc_parsing/declarations/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -1106,11 +1106,13 @@ def _parse_unchecked_block(self, block: Dict, node: NodeSolc, scope):
return node

def _update_reachability(self, node: Node) -> None:
if node.is_reachable:
return
node.set_is_reachable(True)
for son in node.sons:
self._update_reachability(son)
worklist = [node]
while worklist:
current = worklist.pop()
# fix point
if not current.is_reachable:
current.set_is_reachable(True)
worklist.extend(current.sons)

def _parse_cfg(self, cfg: Dict) -> None:

Expand Down

0 comments on commit 28a921e

Please sign in to comment.