about summary refs log tree commit diff stats
path: root/src/emu/x64run.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-02-20 10:45:11 +0100
committerptitSeb <sebastien.chev@gmail.com>2025-02-20 10:45:11 +0100
commita252e87fa93041b4edc79b5168dec1cf8d91bcff (patch)
treeb03d741815bccc728eaea363dd30f40fb5831cd8 /src/emu/x64run.c
parentee3ee539e0841b566f30c6c22895a090a607b51d (diff)
downloadbox64-a252e87fa93041b4edc79b5168dec1cf8d91bcff.tar.gz
box64-a252e87fa93041b4edc79b5168dec1cf8d91bcff.zip
[BOX32][INTERP] Added some support for BOUND opcode ([ARM64_DYNAREC] too)
Diffstat (limited to 'src/emu/x64run.c')
-rw-r--r--src/emu/x64run.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/emu/x64run.c b/src/emu/x64run.c
index 49600889..0fd35d2d 100644
--- a/src/emu/x64run.c
+++ b/src/emu/x64run.c
@@ -432,9 +432,12 @@ x64emurun:
             }
             break;
         case 0x62:                  /* BOUND Gd, Ed */
-            if(rex.is32bits) {
-                nextop = F8;
-                FAKEED(0);
+            nextop = F8;
+            if(rex.is32bits && MODREG) {
+                GETGD;
+                int* bounds = (int*)GETEA(0);
+                if(bounds[0]<GD->dword[0] || bounds[1]>GD->dword[0])
+                    emit_signal(emu, SIGSEGV, (void*)R_RIP, 0xb09d);
             } else {
                 unimp = 1;
                 goto fini;