diff options
| author | Tim Blazytko <tim.blazytko@rub.de> | 2015-05-15 03:31:19 +0200 |
|---|---|---|
| committer | Tim Blazytko <tim.blazytko@rub.de> | 2015-06-02 15:04:04 +0200 |
| commit | 9af5b22b6daaefbae6caadc8943a12baee785329 (patch) | |
| tree | 6aed30ca09365a9cadf98bccf6c8a50d9f18f606 /miasm2/core/graph.py | |
| parent | 31908bddf6ef9443fcbc057c7d8e3cc8514d2cda (diff) | |
| download | miasm-9af5b22b6daaefbae6caadc8943a12baee785329.tar.gz miasm-9af5b22b6daaefbae6caadc8943a12baee785329.zip | |
DiGraph: refactored comments
Diffstat (limited to 'miasm2/core/graph.py')
| -rw-r--r-- | miasm2/core/graph.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/miasm2/core/graph.py b/miasm2/core/graph.py index b1a51c14..b0dc70d6 100644 --- a/miasm2/core/graph.py +++ b/miasm2/core/graph.py @@ -145,7 +145,7 @@ shape = "box" @staticmethod def _reachable_nodes(head, next_cb): - """Generic algorithm to compute every nodes reachable from/to node + """Generic algorithm to compute all nodes reachable from/to node @head""" todo = set([head]) @@ -160,11 +160,13 @@ shape = "box" todo.add(next_node) def reachable_sons(self, head): - """Compute every nodes reachable from node @head""" + """Compute all nodes reachable from node @head. Each son is an + immediate successor of an arbitrary, already yielded son of @head""" return self._reachable_nodes(head, self.successors_iter) def reachable_parents(self, leaf): - """Compute every parents of node @leaf""" + """Compute all parents of node @leaf. Each parent is an immediate + predecessor of an arbitrary, already yielded parent of @leaf""" return self._reachable_nodes(leaf, self.predecessors_iter) @staticmethod @@ -302,7 +304,12 @@ shape = "box" self.successors_iter) def compute_immediate_dominators(self, head): - """Compute the immediate dominators of the graph""" + """ + Compute the immediate dominators of the graph + + Depends on the implementation characteristics of reachable_parents. + Modifications could break this algorithm. + """ dominators = self.compute_dominators(head) idoms = {} |