about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2017-04-14 13:32:59 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2017-04-20 12:31:33 +0200
commit16fc339e53bfc908dbcd73fc912d7d75aed7218c (patch)
treef13faa66157ddd4c12dff191d314d81e5f2bf33f /test
parentff981a11ef71960a239ec44295f06bb384124521 (diff)
downloadmiasm-16fc339e53bfc908dbcd73fc912d7d75aed7218c.tar.gz
miasm-16fc339e53bfc908dbcd73fc912d7d75aed7218c.zip
Ir: make AssignBlock immutable
Diffstat (limited to 'test')
-rw-r--r--test/analysis/data_flow.py5
-rwxr-xr-xtest/ir/symbexec.py3
2 files changed, 5 insertions, 3 deletions
diff --git a/test/analysis/data_flow.py b/test/analysis/data_flow.py
index 1784f87f..e9029e8e 100644
--- a/test/analysis/data_flow.py
+++ b/test/analysis/data_flow.py
@@ -32,6 +32,8 @@ LBL4 = AsmLabel("lbl4")
 LBL5 = AsmLabel("lbl5")
 LBL6 = AsmLabel("lbl6")
 
+IRDst = ExprId('IRDst', 32)
+dummy = ExprId('dummy', 32)
 
 
 def gen_irblock(label, exprs_list):
@@ -43,6 +45,7 @@ def gen_irblock(label, exprs_list):
         else:
             irs.append(AssignBlock(exprs))
 
+    irs.append(AssignBlock({IRDst:dummy}))
     irbl = IRBlock(label, irs, lines)
     return irbl
 
@@ -67,7 +70,7 @@ class IRATest(ira):
     def __init__(self, symbol_pool=None):
         arch = Arch()
         super(IRATest, self).__init__(arch, 32, symbol_pool)
-        self.IRDst = pc
+        self.IRDst = IRDst
         self.ret_reg = r
 
     def get_out_regs(self, _):
diff --git a/test/ir/symbexec.py b/test/ir/symbexec.py
index bd28c4ee..e2bd411f 100755
--- a/test/ir/symbexec.py
+++ b/test/ir/symbexec.py
@@ -63,8 +63,7 @@ class TestSymbExec(unittest.TestCase):
         # apply_change / eval_ir / apply_expr
 
         ## x = a (with a = 0x0)
-        assignblk = AssignBlock()
-        assignblk[id_x] = id_a
+        assignblk = AssignBlock({id_x:id_a})
         e.eval_ir(assignblk)
         self.assertEqual(e.apply_expr(id_x), addr0)