about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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: