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
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: dfb34fcb1abec24f037ea908ef959783dd361b79
diff --git a/src/cxa_exception.cpp b/src/cxa_exception.cpp
index f1679bb..3e20c16 100644
--- a/src/cxa_exception.cpp
+++ b/src/cxa_exception.cpp
@@ -194,8 +194,8 @@
__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);