diff options
author | Howard Hinnant <hhinnant@apple.com> | 2013-02-06 23:29:55 +0400 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2013-02-06 23:29:55 +0400 |
commit | 2b853bf65f677341c0d6786546adf9eae1ce9121 (patch) | |
tree | eb3b2396ec07f4f451252e7eb49d2880d1657653 /libcxxabi/src/cxa_default_handlers.cpp | |
parent | c43636a53d4b19d0ae10132b20020546650f2baf (diff) |
Partially revert r152770. That commit moved the default handlers to their own file. But it also did some refactoring. It is the latter that is being reverted. The refactoring had accidentally removed the required effect that the default unexpected_handler calls std::terminate(), which is a visible effect.
llvm-svn: 174532
Diffstat (limited to 'libcxxabi/src/cxa_default_handlers.cpp')
-rw-r--r-- | libcxxabi/src/cxa_default_handlers.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/libcxxabi/src/cxa_default_handlers.cpp b/libcxxabi/src/cxa_default_handlers.cpp index 0fba79ced8a9..27ffb719b05d 100644 --- a/libcxxabi/src/cxa_default_handlers.cpp +++ b/libcxxabi/src/cxa_default_handlers.cpp @@ -18,8 +18,10 @@ #include "cxa_exception.hpp" #include "private_typeinfo.h" +static const char* cause = "uncaught"; + __attribute__((noreturn)) -static void default_handler(const char* cause) +static void default_terminate_handler() { // If there might be an uncaught exception using namespace __cxxabiv1; @@ -74,17 +76,11 @@ static void default_handler(const char* cause) abort_message("terminating"); } - -__attribute__((noreturn)) -static void default_terminate_handler() -{ - default_handler("uncaught"); -} - __attribute__((noreturn)) static void default_unexpected_handler() { - default_handler("unexpected"); + cause = "unexpected"; + std::terminate(); } |