about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-29 17:24:32 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-03-29 17:24:32 +0200
commit509a1bf56e08d2755b57a6f8fa4c4237169abeaf (patch)
tree721f205aa8f786ddfe4c7f6b1b832d502113b24a /src
parent5b07a475e15baaa1d553f209c3edda20af0288ac (diff)
downloadbox64-509a1bf56e08d2755b57a6f8fa4c4237169abeaf.tar.gz
box64-509a1bf56e08d2755b57a6f8fa4c4237169abeaf.zip
Try to sistematicaly erase upper RAX on cmpxchg opcode
Diffstat (limited to 'src')
-rw-r--r--src/emu/x64run0f.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/emu/x64run0f.c b/src/emu/x64run0f.c
index 667dbb1f..048e1a40 100644
--- a/src/emu/x64run0f.c
+++ b/src/emu/x64run0f.c
@@ -684,13 +684,12 @@ int Run0F(x64emu_t *emu, rex_t rex)
                 }

             } else {

                 cmp32(emu, R_EAX, ED->dword[0]);

+                R_RAX = ED->dword[0];   // to erase upper part of RAX

                 if(ACCESS_FLAG(F_ZF)) {

                     if(MODREG)

                         ED->q[0] = GD->dword[0];

                     else

                         ED->dword[0] = GD->dword[0];

-                } else {

-                    R_RAX = ED->dword[0];

                 }

             }

             break;