summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2012-02-01 18:15:15 +0000
committerHoward Hinnant <hhinnant@apple.com>2012-02-01 18:15:15 +0000
commit8aa78517ab3dff4faeff521bdca94c40419fa204 (patch)
tree941b08c88274461006bf248e6ab3e9aeb225b776 /libcxxabi/src
parent6b8ef34f8483dc8ada88d7c35abf9e280d35e584 (diff)
downloadbcm5719-llvm-8aa78517ab3dff4faeff521bdca94c40419fa204.tar.gz
bcm5719-llvm-8aa78517ab3dff4faeff521bdca94c40419fa204.zip
Treat all exceptions except that the ones that this library throws as foreign. Even other C++ exceptions.
llvm-svn: 149518
Diffstat (limited to 'libcxxabi/src')
-rw-r--r--libcxxabi/src/cxa_exception.cpp4
-rw-r--r--libcxxabi/src/cxa_exception.hpp2
-rw-r--r--libcxxabi/src/cxa_handlers.cpp10
-rw-r--r--libcxxabi/src/cxa_personality.cpp13
4 files changed, 16 insertions, 13 deletions
diff --git a/libcxxabi/src/cxa_exception.cpp b/libcxxabi/src/cxa_exception.cpp
index 0bc8f2ba851..b6b91538458 100644
--- a/libcxxabi/src/cxa_exception.cpp
+++ b/libcxxabi/src/cxa_exception.cpp
@@ -82,8 +82,8 @@ static void setDependentExceptionClass(_Unwind_Exception* unwind_exception) {
// Is it one of ours?
static bool isOurExceptionClass(const _Unwind_Exception* unwind_exception) {
- return (unwind_exception->exception_class & get_language) ==
- (kOurExceptionClass & get_language);
+ return (unwind_exception->exception_class & get_vendor_and_language) ==
+ (kOurExceptionClass & get_vendor_and_language);
}
static bool isDependentException(_Unwind_Exception* unwind_exception) {
diff --git a/libcxxabi/src/cxa_exception.hpp b/libcxxabi/src/cxa_exception.hpp
index 7f392156d03..2b128aa803f 100644
--- a/libcxxabi/src/cxa_exception.hpp
+++ b/libcxxabi/src/cxa_exception.hpp
@@ -19,7 +19,7 @@ namespace __cxxabiv1 {
static const uint64_t kOurExceptionClass = 0x434C4E47432B2B00; // CLNGC++\0
static const uint64_t kOurDependentExceptionClass = 0x434C4E47432B2B01; // CLNGC++\1
-static const uint64_t get_language = 0x00000000FFFFFF00; // mask for C++
+static const uint64_t get_vendor_and_language = 0xFFFFFFFFFFFFFF00; // mask for CLNGC++
struct __cxa_exception {
#if __LP64__
diff --git a/libcxxabi/src/cxa_handlers.cpp b/libcxxabi/src/cxa_handlers.cpp
index 015a06e223d..be43181c9e7 100644
--- a/libcxxabi/src/cxa_handlers.cpp
+++ b/libcxxabi/src/cxa_handlers.cpp
@@ -37,8 +37,9 @@ static void default_terminate_handler()
{
_Unwind_Exception* unwind_exception =
reinterpret_cast<_Unwind_Exception*>(exception_header + 1) - 1;
- bool native_exception = (unwind_exception->exception_class & get_language) ==
- (kOurExceptionClass & get_language);
+ bool native_exception =
+ (unwind_exception->exception_class & get_vendor_and_language) ==
+ (kOurExceptionClass & get_vendor_and_language);
if (native_exception)
{
void* thrown_object =
@@ -167,8 +168,9 @@ terminate() _NOEXCEPT
{
_Unwind_Exception* unwind_exception =
reinterpret_cast<_Unwind_Exception*>(exception_header + 1) - 1;
- bool native_exception = (unwind_exception->exception_class & get_language) ==
- (kOurExceptionClass & get_language);
+ bool native_exception =
+ (unwind_exception->exception_class & get_vendor_and_language) ==
+ (kOurExceptionClass & get_vendor_and_language);
if (native_exception)
{
__cxa_exception* exception_header = (__cxa_exception*)(unwind_exception+1) - 1;
diff --git a/libcxxabi/src/cxa_personality.cpp b/libcxxabi/src/cxa_personality.cpp
index c1d4dc49673..8b2d7328cb5 100644
--- a/libcxxabi/src/cxa_personality.cpp
+++ b/libcxxabi/src/cxa_personality.cpp
@@ -784,8 +784,8 @@ __gxx_personality_v0(int version, _Unwind_Action actions, uint64_t exceptionClas
{
if (version != 1 || unwind_exception == 0 || context == 0)
return _URC_FATAL_PHASE1_ERROR;
- bool native_exception = (exceptionClass & get_language) ==
- (kOurExceptionClass & get_language);
+ bool native_exception = (exceptionClass & get_vendor_and_language) ==
+ (kOurExceptionClass & get_vendor_and_language);
scan_results results;
if (actions & _UA_SEARCH_PHASE)
{
@@ -873,8 +873,9 @@ __cxa_call_unexpected(void* arg)
if (unwind_exception == 0)
call_terminate(false, unwind_exception);
__cxa_begin_catch(unwind_exception);
- bool native_old_exception = (unwind_exception->exception_class & get_language) ==
- (kOurExceptionClass & get_language);
+ bool native_old_exception =
+ (unwind_exception->exception_class & get_vendor_and_language) ==
+ (kOurExceptionClass & get_vendor_and_language);
std::unexpected_handler u_handler;
std::terminate_handler t_handler;
__cxa_exception* old_exception_header = 0;
@@ -931,8 +932,8 @@ __cxa_call_unexpected(void* arg)
// This shouldn't be able to happen!
std::__terminate(t_handler);
bool native_new_exception =
- (new_exception_header->unwindHeader.exception_class & get_language) ==
- (kOurExceptionClass & get_language);
+ (new_exception_header->unwindHeader.exception_class & get_vendor_and_language) ==
+ (kOurExceptionClass & get_vendor_and_language);
void* adjustedPtr;
if (native_new_exception && (new_exception_header != old_exception_header))
{
OpenPOWER on IntegriCloud