diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-01-06 14:59:02 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-01-09 14:28:54 +0100 |
| commit | 6c31f5dd970aa8d8d8959a534a911df6310a195a (patch) | |
| tree | 07dd32addb81dd879d72a56432361db5455fc938 | |
| parent | a4ff9d43483aa01361ab6d1c9afaa50527257ad4 (diff) | |
| download | miasm-6c31f5dd970aa8d8d8959a534a911df6310a195a.tar.gz miasm-6c31f5dd970aa8d8d8959a534a911df6310a195a.zip | |
IR: Add set_dst
| -rw-r--r-- | miasm2/ir/ir.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/miasm2/ir/ir.py b/miasm2/ir/ir.py index 9db6d696..d51693f1 100644 --- a/miasm2/ir/ir.py +++ b/miasm2/ir/ir.py @@ -52,6 +52,17 @@ class irbloc: self._dst = dst return dst + def set_dst(self, value): + dst = None + for ir in self.irs: + for i in ir: + if isinstance(i.dst, m2_expr.ExprId) and i.dst.name == "IRDst": + if dst is not None: + raise ValueError('Multiple destinations!') + dst = value + i.src = value + self._dst = value + dst = property(get_dst) def get_rw(self): |