From ff2627b53e9ddedb1f1e823d4442816ec02054e0 Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Wed, 20 May 2026 12:24:54 +0200 Subject: [PATCH] Add shared JIT warning cleanups --- jit/exception_handler.cpp | 7 ++++--- pcem/x86seg.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/jit/exception_handler.cpp b/jit/exception_handler.cpp index 6e8e12fa..ee099c87 100644 --- a/jit/exception_handler.cpp +++ b/jit/exception_handler.cpp @@ -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; diff --git a/pcem/x86seg.cpp b/pcem/x86seg.cpp index 41656253..48203099 100644 --- a/pcem/x86seg.cpp +++ b/pcem/x86seg.cpp @@ -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(ABRT_GPF | ABRT_EXPECTED); abrt_error = error; } void x86ss(char *s, uint16_t error) -- 2.47.3