X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fwin32-os.c;h=1d5d5908f4263bb759ca37004e39e2a97092acba;hb=cd5a858174d892f876699373dc3ea389cf2c4d40;hp=dc502b0914f43d9e9681609922f6cec1f4d9d2e9;hpb=26ac616b6783b8841ccda8b4f1caa7d898d91b86;p=sbcl.git diff --git a/src/runtime/win32-os.c b/src/runtime/win32-os.c index dc502b0..1d5d590 100644 --- a/src/runtime/win32-os.c +++ b/src/runtime/win32-os.c @@ -70,6 +70,7 @@ os_vm_size_t os_vm_page_size; #include "gc.h" #include "gencgc-internal.h" #include +#include #if 0 int linux_sparc_siginfo_bug = 0; @@ -1373,6 +1374,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 +1423,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 +1462,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) { @@ -2062,6 +2081,9 @@ void scratch(void) /* a function from shell32.dll */ SHGetFolderPathA(0, 0, 0, 0, 0); + + /* from advapi32.dll */ + CryptGenRandom(0, 0, 0); } char *