summaryrefslogtreecommitdiff
path: root/src/cxa_personality.cpp
diff options
context:
space:
mode:
authorLogan Chien <tzuhsiang.chien@gmail.com>2016-11-13 14:44:41 +0000
committerLogan Chien <tzuhsiang.chien@gmail.com>2016-11-13 14:44:41 +0000
commitcc4f512be04098946b4f875d18bd4d69cbcd7463 (patch)
tree19e66d5d68051e6bb725df6e394b21a0cdb35913 /src/cxa_personality.cpp
parent6962eb354b46062b997a740efa1c63724a8d3caf (diff)
arm: Fix ttype encoding assertion failure.
GCC 4.7 or newer emits 0x90 (indirect | pcrel) as the ttype encoding. This would hit an assertion in cxa_personality.cpp. This commit fixes the problem by relaxing the assertion. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@286760 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src/cxa_personality.cpp')
-rw-r--r--src/cxa_personality.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/cxa_personality.cpp b/src/cxa_personality.cpp
index 0b75a1c..75f6b4a 100644
--- a/src/cxa_personality.cpp
+++ b/src/cxa_personality.cpp
@@ -348,7 +348,10 @@ get_shim_type_info(uint64_t ttypeIndex, const uint8_t* classInfo,
call_terminate(native_exception, unwind_exception);
}
- assert(ttypeEncoding == DW_EH_PE_absptr && "Unexpected TTypeEncoding");
+ assert(((ttypeEncoding == DW_EH_PE_absptr) || // LLVM or GCC 4.6
+ (ttypeEncoding == DW_EH_PE_pcrel) || // GCC 4.7 baremetal
+ (ttypeEncoding == (DW_EH_PE_pcrel | DW_EH_PE_indirect))) && // GCC 4.7 linux
+ "Unexpected TTypeEncoding");
(void)ttypeEncoding;
const uint8_t* ttypePtr = classInfo - ttypeIndex * sizeof(uintptr_t);
@@ -415,7 +418,10 @@ exception_spec_can_catch(int64_t specIndex, const uint8_t* classInfo,
call_terminate(false, unwind_exception);
}
- assert(ttypeEncoding == DW_EH_PE_absptr && "Unexpected TTypeEncoding");
+ assert(((ttypeEncoding == DW_EH_PE_absptr) || // LLVM or GCC 4.6
+ (ttypeEncoding == DW_EH_PE_pcrel) || // GCC 4.7 baremetal
+ (ttypeEncoding == (DW_EH_PE_pcrel | DW_EH_PE_indirect))) && // GCC 4.7 linux
+ "Unexpected TTypeEncoding");
(void)ttypeEncoding;
// specIndex is negative of 1-based byte offset into classInfo;