Skip to content

Commit

Permalink
Revert #1984
Browse files Browse the repository at this point in the history
  • Loading branch information
montyly committed Oct 13, 2023
1 parent dab60e0 commit 73f2dc6
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions slither/core/dominators/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,21 @@
def intersection_predecessor(node: "Node") -> Set["Node"]:
if not node.fathers:
return set()
if not any(father.is_reachable for father in node.fathers):
return set()

ret = set()
for pred in node.fathers:
ret = ret.union(pred.dominators)

for pred in node.fathers:
if pred.is_reachable:
ret = ret.intersection(pred.dominators)
# Revert PR1984
ret = node.fathers[0].dominators
for pred in node.fathers[1:]:
ret = ret.intersection(pred.dominators)
# if not any(father.is_reachable for father in node.fathers):
# return set()
#
# ret = set()
# for pred in node.fathers:
# ret = ret.union(pred.dominators)
#
# for pred in node.fathers:
# if pred.is_reachable:
# ret = ret.intersection(pred.dominators)
return ret


Expand Down Expand Up @@ -91,8 +96,9 @@ def compute_dominance_frontier(nodes: List["Node"]) -> None:
for node in nodes:
if len(node.fathers) >= 2:
for father in node.fathers:
if not father.is_reachable:
continue
# Revert PR1984
# if not father.is_reachable:
# continue
runner = father
# Corner case: if there is a if without else
# we need to add update the conditional node
Expand Down

0 comments on commit 73f2dc6

Please sign in to comment.