diff --git a/src/windows.cpp b/src/windows.cpp index 59c6bbacce..21e87f16a8 100644 --- a/src/windows.cpp +++ b/src/windows.cpp @@ -837,11 +837,18 @@ LONG CALLBACK handleException(LPEXCEPTION_POINTERS e) { if (e->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) { + void* ip = reinterpret_cast(e->ContextRecord->Eip); + void* base = reinterpret_cast(e->ContextRecord->Ebp); + void* stack = reinterpret_cast(e->ContextRecord->Esp); + void* thread = reinterpret_cast(e->ContextRecord->Ebx); + bool jump = system->segFaultHandler->handleSignal - (reinterpret_cast(&(e->ContextRecord->Eip)), - reinterpret_cast(&(e->ContextRecord->Ebp)), - reinterpret_cast(&(e->ContextRecord->Esp)), - reinterpret_cast(&(e->ContextRecord->Ebx))); + (&ip, &base, &stack, &thread); + + e->ContextRecord->Eip = reinterpret_cast(ip); + e->ContextRecord->Ebp = reinterpret_cast(base); + e->ContextRecord->Esp = reinterpret_cast(stack); + e->ContextRecord->Ebx = reinterpret_cast(thread); if (jump) { return EXCEPTION_CONTINUE_EXECUTION;