about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2015-02-10 10:17:52 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2015-02-10 10:17:52 +0100
commitfd271e8cc52cfa05f45012335dfe180a0c270fcf (patch)
treefbf2e0358bdda46a6c720f6b95202792d56e4632
parenta222d2a117898eaa91dd85758d4ef47a7af6ef52 (diff)
downloadmiasm-fd271e8cc52cfa05f45012335dfe180a0c270fcf.tar.gz
miasm-fd271e8cc52cfa05f45012335dfe180a0c270fcf.zip
X86/Sem: fix pop esp semantic
Diffstat (limited to '')
-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})