diff options
| author | Camille Mougey <commial@gmail.com> | 2015-01-09 15:40:28 +0100 |
|---|---|---|
| committer | Camille Mougey <commial@gmail.com> | 2015-01-09 15:40:28 +0100 |
| commit | ae9004eec4ef264013208e1ce50f6e884a4da23f (patch) | |
| tree | e09503cc60f0ce9576a830a2bdc78b7f303961f2 /miasm2/ir/ir.py | |
| parent | 0d6454f6b507c3c05c45507ffb56ac9f12eca536 (diff) | |
| parent | 48581006f578d7de1a5944c31952faa5a4e947b4 (diff) | |
| download | miasm-ae9004eec4ef264013208e1ce50f6e884a4da23f.tar.gz miasm-ae9004eec4ef264013208e1ce50f6e884a4da23f.zip | |
Merge pull request #32 from serpilliere/improve_liveness_analysis
Improve liveness analysis
Diffstat (limited to '')
| -rw-r--r-- | miasm2/ir/ir.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/miasm2/ir/ir.py b/miasm2/ir/ir.py index 9db6d696..b955bac7 100644 --- a/miasm2/ir/ir.py +++ b/miasm2/ir/ir.py @@ -52,6 +52,18 @@ class irbloc: self._dst = dst return dst + def set_dst(self, value): + """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": + 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): |