about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-04-20 11:57:18 +0000
committerptitSeb <sebastien.chev@gmail.com>2023-04-20 11:57:18 +0000
commit4e9005be1489133ff25f75b74dccbb2d316ea673 (patch)
tree128e9817a6bda128951d46a3f2b181658c69d0d3 /src
parentf280c6498056dc747089d07725f7f6edd03efd24 (diff)
downloadbox64-4e9005be1489133ff25f75b74dccbb2d316ea673.tar.gz
box64-4e9005be1489133ff25f75b74dccbb2d316ea673.zip
[DYNAREC] Try to test last opcode at end of block for unimplemented opcode
Diffstat (limited to 'src')
-rwxr-xr-xsrc/dynarec/dynarec.c10
-rwxr-xr-xsrc/include/dynarec.h2
2 files changed, 9 insertions, 3 deletions
diff --git a/src/dynarec/dynarec.c b/src/dynarec/dynarec.c
index be7c6a31..f0b0eeb5 100755
--- a/src/dynarec/dynarec.c
+++ b/src/dynarec/dynarec.c
@@ -95,8 +95,11 @@ void DynaCall(x64emu_t* emu, uintptr_t addr)
                 printf_log(LOG_DEBUG, "Setjmp DynaCall, fs=0x%x\n", ejb->emu->segs[_FS]);
                 addr = R_RIP;   // not sure if it should still be inside DynaCall!
                 #ifdef DYNAREC
-                if(box64_dynarec_test)
+                if(box64_dynarec_test) {
+                    if(emu->test.clean)
+                        x64test_check(emu, R_RIP);
                     emu->test.clean = 0;
+                }
                 #endif
             }
         }
@@ -186,8 +189,11 @@ int DynaRun(x64emu_t* emu)
             if(sigsetjmp((struct __jmp_buf_tag*)ejb->jmpbuf, 1))
                 printf_log(LOG_DEBUG, "Setjmp DynaRun, fs=0x%x\n", ejb->emu->segs[_FS]);
                 #ifdef DYNAREC
-                if(box64_dynarec_test)
+                if(box64_dynarec_test) {
+                    if(emu->test.clean)
+                        x64test_check(emu, R_RIP);
                     emu->test.clean = 0;
+                }
                 #endif
         }
     }
diff --git a/src/include/dynarec.h b/src/include/dynarec.h
index 677427bc..64da6041 100755
--- a/src/include/dynarec.h
+++ b/src/include/dynarec.h
@@ -6,6 +6,6 @@ typedef struct x64emu_s x64emu_t;
 void DynaCall(x64emu_t* emu, uintptr_t addr); // try to use DynaRec... Fallback to EmuCall if no dynarec available
 
 void x64test_init(x64emu_t* ref, uintptr_t ip);
-void x64test_check(x64emu_t* ref);
+void x64test_check(x64emu_t* ref, uintptr_t ip);
 
 #endif // __DYNAREC_H_
\ No newline at end of file