diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2016-10-21 23:35:25 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2016-11-04 16:45:46 +0100 |
| commit | 05bdb3651796525100a5cbe160e2f8ad93c80316 (patch) | |
| tree | a8bac3be0583a04f0aee044f25d5b1561e236b21 /miasm2/ir/ir.py | |
| parent | 3771288cffdd53c1ff87857374bd13c550b355dc (diff) | |
| download | miasm-05bdb3651796525100a5cbe160e2f8ad93c80316.tar.gz miasm-05bdb3651796525100a5cbe160e2f8ad93c80316.zip | |
ExprCompose: update api
Diffstat (limited to '')
| -rw-r--r-- | miasm2/ir/ir.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/miasm2/ir/ir.py b/miasm2/ir/ir.py index 3a841fa5..2c6300a9 100644 --- a/miasm2/ir/ir.py +++ b/miasm2/ir/ir.py @@ -59,7 +59,8 @@ class AssignBlock(dict): for r in dst.slice_rest()] all_a = [(src, dst.start, dst.stop)] + rest all_a.sort(key=lambda x: x[1]) - new_src = m2_expr.ExprCompose(all_a) + args = [expr for (expr, _, _) in all_a] + new_src = m2_expr.ExprCompose(*args) else: new_dst, new_src = dst, src @@ -95,7 +96,12 @@ class AssignBlock(dict): for interval in missing_i) # Build the merging expression - new_src = m2_expr.ExprCompose(e_colision.union(remaining)) + args = list(e_colision.union(remaining)) + args.sort(key=lambda x:x[1]) + starts = [start for (_, start, _) in args] + assert len(set(starts)) == len(starts) + args = [expr for (expr, _, _) in args] + new_src = m2_expr.ExprCompose(*args) super(AssignBlock, self).__setitem__(new_dst, new_src) |