about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2021-11-17 08:25:01 +0100
committerGitHub <noreply@github.com>2021-11-17 08:25:01 +0100
commitea5abb5090ef0c8fac2ddde6f99f6f3c4fff432c (patch)
tree6f4e9b34c665fa3c5cff43d0b3b7ec4a88cf278e
parentb825e90d9376bfa1109a21b366c317e79283db8a (diff)
parent3284421fe6a740ff5e85140a39256cda3f562778 (diff)
downloadmiasm-ea5abb5090ef0c8fac2ddde6f99f6f3c4fff432c.tar.gz
miasm-ea5abb5090ef0c8fac2ddde6f99f6f3c4fff432c.zip
Merge pull request #1398 from 0xeb/main
Fixed "POP reg_sp" in all modes
-rw-r--r--miasm/arch/x86/sem.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/miasm/arch/x86/sem.py b/miasm/arch/x86/sem.py
index 5b6ff917..ffa2641c 100644
--- a/miasm/arch/x86/sem.py
+++ b/miasm/arch/x86/sem.py
@@ -929,8 +929,8 @@ def pop_gen(ir, instr, src, size):
 
     sp = mRSP[instr.mode]
     new_sp = sp + m2_expr.ExprInt(src.size // 8, sp.size)
-    # don't generate ESP incrementation on POP ESP
-    if src != ir.sp:
+    # Don't generate SP/ESP/RSP incrementation on POP SP/ESP/RSP
+    if not (src in mRSP.values()):
         e.append(m2_expr.ExprAssign(sp, new_sp))
     # XXX FIX XXX for pop [esp]
     if isinstance(src, m2_expr.ExprMem):