about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2019-02-20 15:13:21 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2019-02-22 10:43:01 +0100
commit1f058c9a34dd52120aa3974e51421aa1989833ea (patch)
tree97966c9527e809ad6005c240ea1f493296f8011a
parent9c063fb1ddd5e6eaa54d6d83048715b3ab8b9191 (diff)
downloadmiasm-1f058c9a34dd52120aa3974e51421aa1989833ea.tar.gz
miasm-1f058c9a34dd52120aa3974e51421aa1989833ea.zip
Dataflow: fix mem propagation
-rw-r--r--miasm2/analysis/data_flow.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/miasm2/analysis/data_flow.py b/miasm2/analysis/data_flow.py
index dc72d06a..5a0ffd4c 100644
--- a/miasm2/analysis/data_flow.py
+++ b/miasm2/analysis/data_flow.py
@@ -900,10 +900,9 @@ class PropagateThroughExprMem(object):
                 for dst, src in out.iteritems():
                     if dst.is_mem():
                         write_mem = True
-                    if dst != mem_dst and mem_dst in dst:
-                        dst = dst.replace_expr({mem_dst:mem_src})
-                    if mem_dst in src:
-                        src = src.replace_expr({mem_dst:mem_src})
+                        ptr = dst.ptr.replace_expr({mem_dst:mem_src})
+                        dst = ExprMem(ptr, dst.size)
+                    src = src.replace_expr({mem_dst:mem_src})
                     out_new[dst] = src
                 if out != out_new:
                     assignblk_modified = True