diff options
| author | Eric Fiselier <eric@efcs.ca> | 2019-12-11 20:32:14 -0500 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2019-12-11 20:32:14 -0500 |
| commit | a9245e4f86165ac38a297138fff08cd4eb7255a7 (patch) | |
| tree | 141f4efd260d200d01197d4960c1a8f6fdbb5c66 /libcxxabi/src | |
| parent | 72b41e6e2d560aee6f52b2f1db385972053bc7d1 (diff) | |
| download | bcm5719-llvm-a9245e4f86165ac38a297138fff08cd4eb7255a7.tar.gz bcm5719-llvm-a9245e4f86165ac38a297138fff08cd4eb7255a7.zip | |
[libc++abi] Fix non-constant initialization of default terminate
handlers.
Diffstat (limited to 'libcxxabi/src')
| -rw-r--r-- | libcxxabi/src/cxa_default_handlers.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libcxxabi/src/cxa_default_handlers.cpp b/libcxxabi/src/cxa_default_handlers.cpp index 573694d4ebe..d2f823d2b77 100644 --- a/libcxxabi/src/cxa_default_handlers.cpp +++ b/libcxxabi/src/cxa_default_handlers.cpp @@ -18,6 +18,8 @@ #include "include/atomic_support.h" #if !defined(LIBCXXABI_SILENT_TERMINATE) + +_LIBCPP_SAFE_STATIC static const char* cause = "uncaught"; __attribute__((noreturn)) @@ -82,21 +84,21 @@ static void demangling_unexpected_handler() std::terminate(); } -static std::terminate_handler default_terminate_handler = demangling_terminate_handler; -static std::terminate_handler default_unexpected_handler = demangling_unexpected_handler; +static constexpr std::terminate_handler default_terminate_handler = demangling_terminate_handler; +static constexpr std::terminate_handler default_unexpected_handler = demangling_unexpected_handler; #else -static std::terminate_handler default_terminate_handler = ::abort; -static std::terminate_handler default_unexpected_handler = std::terminate; +static constexpr std::terminate_handler default_terminate_handler = ::abort; +static constexpr std::terminate_handler default_unexpected_handler = std::terminate; #endif // // Global variables that hold the pointers to the current handler // _LIBCXXABI_DATA_VIS -std::terminate_handler __cxa_terminate_handler = default_terminate_handler; +_LIBCPP_SAFE_STATIC std::terminate_handler __cxa_terminate_handler = default_terminate_handler; _LIBCXXABI_DATA_VIS -std::unexpected_handler __cxa_unexpected_handler = default_unexpected_handler; +_LIBCPP_SAFE_STATIC std::unexpected_handler __cxa_unexpected_handler = default_unexpected_handler; namespace std { |

