diff options
| author | Camille Mougey <commial@gmail.com> | 2017-01-05 14:37:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-05 14:37:58 +0100 |
| commit | afdeb68de2b634c600c30f61422f9fd59286376c (patch) | |
| tree | b6d26760a41e711563f3345135b327a2f9545fda | |
| parent | c551e1e761b14b962ae327e6752599b7934ba9cc (diff) | |
| parent | f0a5217b177a5904a904f7d57577f79a72c7b1f0 (diff) | |
| download | miasm-afdeb68de2b634c600c30f61422f9fd59286376c.tar.gz miasm-afdeb68de2b634c600c30f61422f9fd59286376c.zip | |
Merge pull request #466 from serpilliere/fix_empty_dst
IR: fix set_empty_dst using c_next
| -rw-r--r-- | miasm2/ir/ir.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/miasm2/ir/ir.py b/miasm2/ir/ir.py index 582faee6..0d4ec9fb 100644 --- a/miasm2/ir/ir.py +++ b/miasm2/ir/ir.py @@ -409,8 +409,13 @@ class ir(object): for b in ir_blocs: if b.dst is not None: continue - dst = m2_expr.ExprId(self.get_next_label(bloc.lines[-1]), - self.pc.size) + next_lbl = bloc.get_next() + if next_lbl is None: + dst = m2_expr.ExprId(self.get_next_label(bloc.lines[-1]), + self.pc.size) + else: + dst = m2_expr.ExprId(next_lbl, + self.pc.size) b.irs.append(AssignBlock([m2_expr.ExprAff(self.IRDst, dst)])) b.lines.append(b.lines[-1]) |