diff --git a/miasm/core/graph.py b/miasm/core/graph.py index 0dfd7e6ac..0d7ce52f4 100644 --- a/miasm/core/graph.py +++ b/miasm/core/graph.py @@ -416,12 +416,12 @@ def _compute_generic_dominators(head, reachable_cb, prev_cb, next_cb): dominators[node] = set(nodes) dominators[head] = set([head]) - todo = set(nodes) + todo = set([n for n in next_cb(head)]) while todo: node = todo.pop() - # Heads state must not be changed + # Head's state must not be changed if node == head: continue @@ -446,6 +446,7 @@ def _compute_generic_dominators(head, reachable_cb, prev_cb, next_cb): dominators[node] = new_dom for succ in next_cb(node): todo.add(succ) + return dominators def compute_dominators(self, head):