X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fwin32-os.c;h=49358a14370c9f93a9d61dd353c2f1755a7cd51c;hb=43c6634142a96e1d1bab2efe1a39cd8234903c41;hp=dc502b0914f43d9e9681609922f6cec1f4d9d2e9;hpb=26ac616b6783b8841ccda8b4f1caa7d898d91b86;p=sbcl.git diff --git a/src/runtime/win32-os.c b/src/runtime/win32-os.c index dc502b0..49358a1 100644 --- a/src/runtime/win32-os.c +++ b/src/runtime/win32-os.c @@ -1373,6 +1373,13 @@ handle_exception(EXCEPTION_RECORD *exception_record, context.sigmask = self ? self->os_thread->blocked_signal_set : 0; #endif + os_context_register_t oldbp = NULL; + if (self) { + oldbp = self ? self->carried_base_pointer : 0; + self->carried_base_pointer + = (os_context_register_t) voidreg(win32_context, bp); + } + /* For EXCEPTION_ACCESS_VIOLATION only. */ void *fault_address = (void *)exception_record->ExceptionInformation[1]; @@ -1415,6 +1422,9 @@ handle_exception(EXCEPTION_RECORD *exception_record, /* All else failed, drop through to the lisp-side exception handler. */ signal_internal_error_or_lose(ctx, exception_record, fault_address); + if (self) + self->carried_base_pointer = oldbp; + errno = lastErrno; SetLastError(lastError); return ExceptionContinueExecution; @@ -1451,6 +1461,14 @@ veh(EXCEPTION_POINTERS *ep) } #endif +os_context_register_t +carry_frame_pointer(os_context_register_t default_value) +{ + struct thread* self = arch_os_get_current_thread(); + os_context_register_t bp = self->carried_base_pointer; + return bp ? bp : default_value; +} + void wos_install_interrupt_handlers(struct lisp_exception_frame *handler) {