about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2015-11-17 10:08:58 +0100
committerAjax <commial@gmail.com>2015-11-17 10:39:42 +0100
commitf2bf75cfd3ce105735b802458978779c887d1885 (patch)
tree238038e99dd3740a7fd7b6317cf0581269a0836f
parent57d5a9b758d30be4ae607712d3361d678baacdd1 (diff)
downloadmiasm-f2bf75cfd3ce105735b802458978779c887d1885.tar.gz
miasm-f2bf75cfd3ce105735b802458978779c887d1885.zip
Symbexec: fix parallelism with memory accesses
Diffstat (limited to '')
-rw-r--r--miasm2/ir/symbexec.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/miasm2/ir/symbexec.py b/miasm2/ir/symbexec.py
index f51baf9f..162f566c 100644
--- a/miasm2/ir/symbexec.py
+++ b/miasm2/ir/symbexec.py
@@ -384,10 +384,7 @@ class symbexec(object):
                 # test if mem lookup is known
                 tmp = m2_expr.ExprMem(a, e.dst.size)
                 dst = tmp
-                if self.func_write and isinstance(dst.arg, m2_expr.ExprInt):
-                    self.func_write(self, dst, src, pool_out)
-                else:
-                    pool_out[dst] = src
+                pool_out[dst] = src
 
             elif isinstance(e.dst, m2_expr.ExprId):
                 pool_out[e.dst] = src
@@ -398,7 +395,6 @@ class symbexec(object):
 
     def eval_ir(self, ir):
         mem_dst = []
-        # src_dst = [(x.src, x.dst) for x in ir]
         src_dst = self.eval_ir_expr(ir)
         eval_cache = dict(self.symbols.items())
         for dst, src in src_dst:
@@ -411,10 +407,11 @@ class symbexec(object):
                         new_val.is_term = True
                         self.symbols[new_mem] = new_val
             src_o = self.expr_simp(src)
-            # print 'SRCo', src_o
-            # src_o.is_term = True
             self.symbols[dst] = src_o
             if isinstance(dst, m2_expr.ExprMem):
+                if self.func_write and isinstance(dst.arg, m2_expr.ExprInt):
+                    self.func_write(self, dst, src_o, {})
+                    del self.symbols[dst]
                 mem_dst.append(dst)
         return mem_dst