Updated __cxa_current_exception_type to call __cxa_get_globals_fast - will not allocate globals
llvm-svn: 147147
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 1de4fc0dfa9ee9f3bf2d7dfa7b8730740ac61b83
diff --git a/src/cxa_exception.cpp b/src/cxa_exception.cpp
index 2ee146a..77ac7c5 100644
--- a/src/cxa_exception.cpp
+++ b/src/cxa_exception.cpp
@@ -296,7 +296,9 @@
std::type_info * __cxa_current_exception_type() {
// get the current exception
- __cxa_eh_globals *globals = __cxa_get_globals();
+ __cxa_eh_globals *globals = __cxa_get_globals_fast();
+ if (NULL == globals)
+ return NULL; // If there have never been any exceptions, there are none now.
__cxa_exception *current_exception = globals->caughtExceptions;
if (NULL == current_exception)
return NULL; // No current exception