diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2019-03-25 23:21:13 +0100 |
|---|---|---|
| committer | serpilliere <serpilliere@droids-corp.org> | 2020-02-14 21:42:38 +0100 |
| commit | 9b5fc45ea59446018d2e6c938b6b872f5b3b5bbe (patch) | |
| tree | 5f1189cb0aef3184de504c0fd963d5d3eea33fd8 | |
| parent | 4ef1b5106662ea83da8309749402f267a4a9946c (diff) | |
| download | miasm-9b5fc45ea59446018d2e6c938b6b872f5b3b5bbe.tar.gz miasm-9b5fc45ea59446018d2e6c938b6b872f5b3b5bbe.zip | |
DataFlow: manage incomplete graphs
| -rw-r--r-- | miasm/analysis/data_flow.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/miasm/analysis/data_flow.py b/miasm/analysis/data_flow.py index d8519bcd..57837a5d 100644 --- a/miasm/analysis/data_flow.py +++ b/miasm/analysis/data_flow.py @@ -69,6 +69,8 @@ class ReachingDefinitions(dict): """ predecessor_state = {} for pred_lbl in self.ircfg.predecessors(block.loc_key): + if pred_lbl not in self.ircfg.blocks: + continue pred = self.ircfg.blocks[pred_lbl] for lval, definitions in viewitems(self.get_definitions(pred_lbl, len(pred))): predecessor_state.setdefault(lval, set()).update(definitions) @@ -790,6 +792,8 @@ class PropagateThroughExprId(object): else: # Check everyone but node_a.label and node_b.label for loc in nodes_to_do - set([node_a.label, node_b.label]): + if loc not in ssa.graph.blocks: + continue block = ssa.graph.blocks[loc] if self.has_propagation_barrier(block.assignblks): return True @@ -1693,6 +1697,8 @@ class DiGraphLivenessSSA(DiGraphLivenessIRA): self.loc_key_to_phi_parents[irblock.loc_key] = out def back_propagate_to_parent(self, todo, node, parent): + if parent not in self.blocks: + return parent_block = self.blocks[parent] cur_block = self.blocks[node] irblock = self.ircfg.blocks[node] |