From 73f2dc6989242398297cddd7876aefaa4b945181 Mon Sep 17 00:00:00 2001 From: Feist Josselin Date: Fri, 13 Oct 2023 10:28:46 +0200 Subject: [PATCH] Revert #1984 --- slither/core/dominators/utils.py | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/slither/core/dominators/utils.py b/slither/core/dominators/utils.py index 77ff22611f..eb20ef00cb 100644 --- a/slither/core/dominators/utils.py +++ b/slither/core/dominators/utils.py @@ -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 @@ -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