diff options
| author | Tim Blazytko <tim.blazytko@rub.de> | 2015-09-05 12:52:08 +0200 |
|---|---|---|
| committer | Tim Blazytko <tim.blazytko@rub.de> | 2015-09-05 12:52:08 +0200 |
| commit | 3c8bfdda01f8dec3777227997bfc4d8785927c71 (patch) | |
| tree | fcdf37bcd9af9e8db7636c5c91ef5927c58e316c /miasm2/core/graph.py | |
| parent | 2ed5645e483dd5396c6d285dc0dd6256b62d0d73 (diff) | |
| download | miasm-3c8bfdda01f8dec3777227997bfc4d8785927c71.tar.gz miasm-3c8bfdda01f8dec3777227997bfc4d8785927c71.zip | |
DiGraph: refactored compute_strongly_connected_components
Diffstat (limited to 'miasm2/core/graph.py')
| -rw-r--r-- | miasm2/core/graph.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/miasm2/core/graph.py b/miasm2/core/graph.py index 6b183ef3..8330c472 100644 --- a/miasm2/core/graph.py +++ b/miasm2/core/graph.py @@ -458,7 +458,7 @@ shape = "box" if index[node]: continue - todo = [(0, node)] + todo = [('visit', node)] done = set() while todo: @@ -468,21 +468,21 @@ shape = "box" continue # node is unvisited - if val == 0: + if val == 'visit': stack.append(node) index[node] = len(stack) boundaries.append(index[node]) - todo.append((-2, node)) + todo.append(('merge', node)) # follow successors for successor in self.successors_iter(node): - todo.append((-1, successor)) + todo.append(('handle_recursion', successor)) # iterative handling of recursion algorithm - elif val == -1: + elif val == 'handle_recursion': # visit unvisited successor if index[node] == 0: - todo.append((0, node)) + todo.append(('visit', node)) else: # contract cycle if necessary while index[node] < boundaries[-1]: |