]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Add shared JIT warning cleanups
authorDimitris Panokostas <midwan@gmail.com>
Wed, 20 May 2026 10:24:54 +0000 (12:24 +0200)
committerDimitris Panokostas <midwan@gmail.com>
Wed, 20 May 2026 10:27:29 +0000 (12:27 +0200)
jit/exception_handler.cpp
pcem/x86seg.cpp

index 6e8e12fac614bf69f280fb2bcb8806334c3e288a..ee099c8745cf64dbda21ef2b83fdfad5d428b1b3 100644 (file)
@@ -400,7 +400,7 @@ static int handle_access(uintptr_t fault_addr, CONTEXT_T context)
                return 0;
        }
 
-       uae_u32 addr = uae_p32(fault_addr) - uae_p32(NATMEM_OFFSET);
+       uae_u32 addr = (uae_u32)(fault_addr - (uintptr_t)NATMEM_OFFSET);
 #ifdef DEBUG_ACCESS
        if (addr >= 0x80000000) {
                write_log (_T("JIT: Suspicious address 0x%x in SEGV handler.\n"), addr);
@@ -508,7 +508,7 @@ static int handle_access(uintptr_t fault_addr, CONTEXT_T context)
                return 0;
        }
 
-       uae_u32 addr = uae_p32(fault_addr) - uae_p32(NATMEM_OFFSET);
+       uae_u32 addr = (uae_u32)(fault_addr - (uintptr_t)NATMEM_OFFSET);
 #ifdef DEBUG_ACCESS
        if (addr >= 0x80000000) {
                        write_log (_T("JIT: Suspicious address 0x%x in SEGV handler.\n"), addr);
@@ -600,7 +600,8 @@ LONG WINAPI EvalException(LPEXCEPTION_POINTERS info)
        }
        if (currprefs.comp_catchfault) {
                // setup fake exception
-               exception2_setup(regs.opcode, uae_p32(address) - uae_p32(NATMEM_OFFSET), info->ExceptionRecord->ExceptionInformation[0] == 0, 1, regs.s ? 4 : 0);
+               uae_u32 amiga_addr = (uae_u32)(address - (uintptr_t)NATMEM_OFFSET);
+               exception2_setup(regs.opcode, amiga_addr, info->ExceptionRecord->ExceptionInformation[0] == 0, 1, regs.s ? 4 : 0);
                return EXCEPTION_EXECUTE_HANDLER;
        }
        return EXCEPTION_CONTINUE_SEARCH;
index 4165625386dd86b21655c9196b452c6e7b08ea9e..48203099927966b14b063f1667f6b416bbb4f302 100644 (file)
@@ -181,7 +181,7 @@ void x86gpf(const char *s, uint16_t error)
 void x86gpf_expected(const char *s, uint16_t error)
 {
 //        pclog("GPF_v86 %04X %04x(%08x):%08x\n", error, CS,cs,cpu_state.pc);
-        cpu_state.abrt = ABRT_GPF | ABRT_EXPECTED;
+        cpu_state.abrt = static_cast<int8_t>(ABRT_GPF | ABRT_EXPECTED);
         abrt_error = error;
 }
 void x86ss(char *s, uint16_t error)