diff options
| author | serpilliere <fabrice.desclaux@cea.fr> | 2015-02-21 21:09:07 +0100 |
|---|---|---|
| committer | serpilliere <fabrice.desclaux@cea.fr> | 2015-02-22 01:48:27 +0100 |
| commit | dd2da246f676ff827201c9eee3ae698081875bf7 (patch) | |
| tree | 92f0b1839ac0398426ad0332cd973cf9b41ca8c9 /miasm2/ir/ir.py | |
| parent | f26427471fb9cda89b36b1d2609a9f58f1d79d68 (diff) | |
| download | miasm-dd2da246f676ff827201c9eee3ae698081875bf7.tar.gz miasm-dd2da246f676ff827201c9eee3ae698081875bf7.zip | |
Expression: remove code which uses expression modifications
Diffstat (limited to 'miasm2/ir/ir.py')
| -rw-r--r-- | miasm2/ir/ir.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/miasm2/ir/ir.py b/miasm2/ir/ir.py index 73a38242..3a8cbb14 100644 --- a/miasm2/ir/ir.py +++ b/miasm2/ir/ir.py @@ -55,12 +55,12 @@ class irbloc(object): """Find and replace the IRDst affectation's source by @value""" dst = None for ir in self.irs: - for i in ir: - if isinstance(i.dst, m2_expr.ExprId) and i.dst.name == "IRDst": + for i, expr in enumerate(ir): + if isinstance(expr.dst, m2_expr.ExprId) and expr.dst.name == "IRDst": if dst is not None: raise ValueError('Multiple destinations!') dst = value - i.src = value + ir[i] = m2_expr.ExprAff(expr.dst, value) self._dst = value dst = property(get_dst, set_dst) @@ -296,8 +296,7 @@ class ir(object): for b in self.blocs.values(): for ir in b.irs: for i, r in enumerate(ir): - ir[i].src = expr_simp(r.src) - ir[i].dst = expr_simp(r.dst) + ir[i] = m2_expr.ExprAff(expr_simp(r.dst), expr_simp(r.src)) def replace_expr_in_ir(self, bloc, rep): for irs in bloc.irs: |