about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--miasm2/arch/x86/sem.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py
index 96f0bb62..9763b07c 100644
--- a/miasm2/arch/x86/sem.py
+++ b/miasm2/arch/x86/sem.py
@@ -512,7 +512,9 @@ def _shift_tpl(op, ir, instr, a, b, c=None, op_inv=None):
 
     e_do = [
         m2_expr.ExprAff(cf, new_cf),
-        m2_expr.ExprAff(of, m2_expr.ExprInt_from(of, 0)),
+        m2_expr.ExprAff(of, m2_expr.ExprCond(shifter - m2_expr.ExprInt(1, size=shifter.size),
+                                             m2_expr.ExprInt_from(of, 0),
+                                             b[:1] ^ a.msb())),
         m2_expr.ExprAff(a, res),
     ]