Substituted std::get_terminate() for direct access to the handler function pointer (which is now a static in cxa_handlers.cpp). This has the advantage of going through the atomic API and so is less likely to cause a data race. Ditto for unexpected.

llvm-svn: 145951
This commit is contained in:
Howard Hinnant
2011-12-06 19:02:03 +00:00
parent 1ad92487ff
commit dfb34fcb1a

View File

@@ -194,8 +194,8 @@ __cxa_throw(void * thrown_exception, std::type_info * tinfo, void (*dest)(void *
__cxa_eh_globals *globals = __cxa_get_globals();
__cxa_exception *exception = exception_from_thrown_object(thrown_exception);
exception->unexpectedHandler = __cxxabiapple::__cxa_unexpected_handler;
exception->terminateHandler = __cxxabiapple::__cxa_terminate_handler;
exception->unexpectedHandler = std::get_unexpected();
exception->terminateHandler = std::get_terminate();
exception->exceptionType = tinfo;
exception->exceptionDestructor = dest;
setExceptionClass(&exception->unwindHeader);