--- hatari/src/cpu/jit/exception_handler.c 2019/04/09 08:56:45 1.1.1.1 +++ hatari/src/cpu/jit/exception_handler.c 2019/04/09 08:59:16 1.1.1.3 @@ -21,8 +21,6 @@ static uae_u8 *veccode; #if defined(JIT_DEBUG) #define DEBUG_ACCESS -#elif defined(CPU_x86_64) -#define DEBUG_ACCESS #endif #if defined(_WIN32) && defined(CPU_x86_64) @@ -420,8 +418,7 @@ static int handle_access(uintptr_t fault uae_u32 addr = uae_p32(fault_addr) - uae_p32(NATMEM_OFFSET); #ifdef DEBUG_ACCESS - if ((addr >= 0x10000000 && addr < 0x40000000) || - (addr >= 0x50000000)) { + if (addr >= 0x80000000) { write_log (_T("JIT: Suspicious address 0x%x in SEGV handler.\n"), addr); } addrbank *ab = &get_mem_bank(addr); @@ -442,7 +439,6 @@ static int handle_access(uintptr_t fault write_log(_T("JIT: Create jump to %p\n"), veccode); write_log(_T("JIT: Handled one access!\n")); #endif - segvcount++; target = veccode; if (dir == SIG_READ) { @@ -509,6 +505,11 @@ LONG WINAPI EvalException(LPEXCEPTION_PO if (handle_access(address, info)) { return EXCEPTION_CONTINUE_EXECUTION; } + if (currprefs.comp_catchfault) { + // setup fake exception + exception2_setup(uae_p32(address) - uae_p32(NATMEM_OFFSET), info->ExceptionRecord->ExceptionInformation[0] == 0, 1, regs.s ? 4 : 0); + return EXCEPTION_EXECUTE_HANDLER; + } return EXCEPTION_CONTINUE_SEARCH; }