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 22e8c276..6fc2e96b 100644
--- a/miasm2/arch/x86/sem.py
+++ b/miasm2/arch/x86/sem.py
@@ -635,7 +635,9 @@ def pop(ir, instr, a):
     if not s in [16, 32, 64]:
         raise ValueError('bad size stacker!')
     new_esp = mRSP[instr.mode][:s] + ExprInt_fromsize(s, off / 8)
-    e.append(ExprAff(mRSP[instr.mode][:s], new_esp))
+    # don't generate ESP incrementation on POP ESP
+    if a != ir.sp:
+        e.append(ExprAff(mRSP[instr.mode][:s], new_esp))
     # XXX FIX XXX for pop [esp]
     if isinstance(a, ExprMem):
         a = a.replace_expr({mRSP[instr.mode]: new_esp})