about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2016-01-28 10:49:13 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2016-01-29 14:51:17 +0100
commit0b9038965f128d36b3ba20c8848f7f185200bc39 (patch)
treea0a8ca6cb261c9660265d3b2f1dde9b6fccbab1c
parentaf325fab734096680e835a4af69456dd05cfe2ec (diff)
downloadmiasm-0b9038965f128d36b3ba20c8848f7f185200bc39.tar.gz
miasm-0b9038965f128d36b3ba20c8848f7f185200bc39.zip
Sem/x86: fix get_shift imm size
-rw-r--r--miasm2/arch/x86/sem.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py
index fde5e5f0..c2d84253 100644
--- a/miasm2/arch/x86/sem.py
+++ b/miasm2/arch/x86/sem.py
@@ -421,7 +421,10 @@ def l_test(ir, instr, a, b):
 
 def get_shift(a, b):
     # b.size must match a
-    b = b.zeroExtend(a.size)
+    if isinstance(b, m2_expr.ExprInt):
+        b = m2_expr.ExprInt(int(b.arg), a.size)
+    else:
+        b = b.zeroExtend(a.size)
     if a.size == 64:
         shift = b & m2_expr.ExprInt_from(b, 0x3f)
     else: