From 2b853bf65f677341c0d6786546adf9eae1ce9121 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Wed, 6 Feb 2013 19:29:55 +0000 Subject: [PATCH] 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 --- libcxxabi/src/cxa_default_handlers.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/libcxxabi/src/cxa_default_handlers.cpp b/libcxxabi/src/cxa_default_handlers.cpp index 0fba79c..27ffb71 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(); } -- 2.7.4