about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--miasm2/ir/ir.py11
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):