diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2015-02-24 13:44:09 +0100 |
|---|---|---|
| committer | serpilliere <serpilliere@users.noreply.github.com> | 2015-02-24 13:44:09 +0100 |
| commit | 2a14327dfb9df55f67f9abc818c461aebe6d7918 (patch) | |
| tree | 99db30cad40d8b8b172b333b132fb9c66df6cc43 | |
| parent | e593a348527eab2f69005ee934cfce448eac5d5e (diff) | |
| parent | 3f0ffb84ccf7cb9d469281129e8c525295e39deb (diff) | |
| download | miasm-2a14327dfb9df55f67f9abc818c461aebe6d7918.tar.gz miasm-2a14327dfb9df55f67f9abc818c461aebe6d7918.zip | |
Merge pull request #89 from commial/fix-depgraph
Fix depgraph
| -rw-r--r-- | miasm2/analysis/depgraph.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/miasm2/analysis/depgraph.py b/miasm2/analysis/depgraph.py index 06b5b8b6..72d0176b 100644 --- a/miasm2/analysis/depgraph.py +++ b/miasm2/analysis/depgraph.py @@ -508,11 +508,15 @@ class DependencyGraph(object): # No more dependencies if len(depdict.pending) == 0: - yield depdict + yield depdict.copy() continue + # Has a predecessor ? + is_final = True + # Propagate the DependencyDict to all parents for label, irb_len in self._get_previousblocks(depdict.label): + is_final = False ## Duplicate the DependencyDict new_depdict = depdict.extend(label) @@ -529,8 +533,9 @@ class DependencyGraph(object): ## Manage the new element todo.append(new_depdict) - # Return the node if it's a final one, ie. it's a head - if depdict.label in heads: + # Return the node if it's a final one, ie. it's a head (in graph + # or defined by caller) + if is_final or depdict.label in heads: yield depdict.copy() def get(self, label, elements, line_nb, heads): |