diff options
| author | Eric Fiselier <eric@efcs.ca> | 2016-09-28 22:08:13 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2016-09-28 22:08:13 +0000 |
| commit | ea117bf9ad162950a1fdd527f8b75d1bdf22456b (patch) | |
| tree | 15a1200a1f8fa5699cd0ad28e13e070b063483fe /libcxx/src/exception.cpp | |
| parent | 392caa538dfa29757f8f1e8635508affab2b1072 (diff) | |
Mark libc++ internal globals with _LIBCPP_SAFE_STATIC.
This patch applies the _LIBCPP_SAFE_STATIC attribute to internal globals,
most of which are locking primitives, in order to ensure that they can
safely be used during program startup.
This patch also fixes an unsafe static init issue with the global locks
used to implement atomic operations on shared pointers. Previously the
locks were initialized using a dynamically initialized pointer, so it was
possible that the pointer was uninitialized.
llvm-svn: 282640
Diffstat (limited to 'libcxx/src/exception.cpp')
| -rw-r--r-- | libcxx/src/exception.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/src/exception.cpp b/libcxx/src/exception.cpp index e172f642d483..96bd7ee59a02 100644 --- a/libcxx/src/exception.cpp +++ b/libcxx/src/exception.cpp @@ -32,8 +32,8 @@ #define HAVE_DEPENDENT_EH_ABI 1 #endif #elif !defined(__GLIBCXX__) // defined(LIBCXX_BUILDING_LIBCXXABI) - static std::terminate_handler __terminate_handler; - static std::unexpected_handler __unexpected_handler; + _LIBCPP_SAFE_STATIC static std::terminate_handler __terminate_handler; + _LIBCPP_SAFE_STATIC static std::unexpected_handler __unexpected_handler; #endif // defined(LIBCXX_BUILDING_LIBCXXABI) namespace std |
