From d5d5bf4dd5609dd29e511d688e317b2f0f1987ca Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 26 Feb 2010 21:36:31 +0000 Subject: * cygtls.h (_cygtls::init_exception_handler): Eliminate argument. (_cygtls::andreas): Convert to a pointer. (san): Convert to a real class with methods. Use a linked list to keep track of previous handlers on the "stack". (myfault): Rewrite to use new san class rather than calling directly into _cygtls. * cygtls.cc (_cygtls::init_exception_handler): Just assume that we're always using the standard exception handler. (_cygtls::init_thread): Reflect loss of argument to init_exception_handler. * dcrt0.cc (dll_crt0_1): Ditto. * dfcn.cc (dlopen): Ditto. (dlclose): Reset the exception handler after FreeLibrary. * dll_init.cc (dll_list::detach): Make sure that the exception handler is initialized before calling destructors. * exceptions.cc (_cygtls::handle_exceptions): Accommodate new andreas pointer. * thread.cc (verifyable_object_isvalid): Pass objectptr to faulted for explicit NULL pointer checking. * tlsoffsets.h: Regenerate. --- winsup/cygwin/dll_init.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/dll_init.cc') diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc index 055b1060f..8fef9d8b1 100644 --- a/winsup/cygwin/dll_init.cc +++ b/winsup/cygwin/dll_init.cc @@ -169,6 +169,8 @@ dll_list::detach (void *retaddr) system_printf ("WARNING: trying to detach an already detached dll ..."); if (--d->count == 0) { + /* Make sure our exception handler is enabled for destructors */ + _my_tls.init_exception_handler (); __cxa_finalize (d); d->run_dtors (); d->prev->next = d->next; @@ -329,7 +331,7 @@ dll_dllcrt0_1 (VOID *x) the exception handler should be guaranteed to be installed. I'm leaving it in until potentially after the release of 1.7.1 */ - _my_tls.init_exception_handler (_cygtls::handle_exceptions); + _my_tls.init_exception_handler (); if (p == NULL) p = &__cygwin_user_data; -- cgit v1.2.3