about summary refs log tree commit diff stats
path: root/miasm2/expression
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2018-07-04 15:19:29 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2018-07-19 13:17:49 +0200
commita7e3b1b6237c94e932fcf2f2f9f268f04c7b34c7 (patch)
tree36daa35a0e1725f748d967745e15b641095a3137 /miasm2/expression
parenta5925ddba272cb9ca85ebc22d906a306dab56147 (diff)
downloadmiasm-a7e3b1b6237c94e932fcf2f2f9f268f04c7b34c7.tar.gz
miasm-a7e3b1b6237c94e932fcf2f2f9f268f04c7b34c7.zip
Expression: fix slice assignment
Diffstat (limited to 'miasm2/expression')
-rw-r--r--miasm2/expression/expression.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/miasm2/expression/expression.py b/miasm2/expression/expression.py
index 3cf37070..11400e9e 100644
--- a/miasm2/expression/expression.py
+++ b/miasm2/expression/expression.py
@@ -715,7 +715,9 @@ class ExprAff(Expr):
         return self.__class__, state
 
     def __new__(cls, dst, src):
-        if isinstance(dst, ExprSlice):
+        if dst.is_slice() and dst.arg.size == src.size:
+            new_dst, new_src = dst.arg, src
+        elif dst.is_slice():
             # Complete the source with missing slice parts
             new_dst = dst.arg
             rest = [(ExprSlice(dst.arg, r[0], r[1]), r[0], r[1])