diff options
author | Howard Hinnant <hhinnant@apple.com> | 2012-01-31 17:15:14 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2012-01-31 17:15:14 +0000 |
commit | a5f9da203dc18d2c34909a63d12c2604f6d006d9 (patch) | |
tree | db2c809e75b85f5908f9cdef9a3ccaf83367d347 /src/cxa_personality.cpp | |
parent | 1a58491066c80bd4b599e49fe0930b9390807e0b (diff) |
Found and fixed bug in personality function: Don't dive into the action table if the action entry is zero.
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@149389 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src/cxa_personality.cpp')
-rw-r--r-- | src/cxa_personality.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cxa_personality.cpp b/src/cxa_personality.cpp index 1b6f1c4..fa9ed28 100644 --- a/src/cxa_personality.cpp +++ b/src/cxa_personality.cpp @@ -519,8 +519,7 @@ scan_eh_tab(scan_results& results, _Unwind_Action actions, bool native_exception if (actionEntry == 0) { // Found a cleanup - // If this is a type 1 or type 2 search, ignore the clean up - // and continue to scan for a handler. + // If this is a type 1 or type 2 search, there are no handlers // If this is a type 3 search, you want to install the cleanup. if ((actions & _UA_CLEANUP_PHASE) && !(actions & _UA_HANDLER_FRAME)) { @@ -529,6 +528,9 @@ scan_eh_tab(scan_results& results, _Unwind_Action actions, bool native_exception results.reason = _URC_HANDLER_FOUND; return; } + // No handler here + results.reason = _URC_CONTINUE_UNWIND; + return; } // Convert 1-based byte offset into const uint8_t* action = actionTableStart + (actionEntry - 1); @@ -814,7 +816,9 @@ __gxx_personality_v0(int version, _Unwind_Action actions, uint64_t exceptionClas results.adjustedPtr = exception_header->adjustedPtr; } else + { scan_eh_tab(results, actions, native_exception, unwind_exception, context); + } _Unwind_SetGR(context, __builtin_eh_return_data_regno(0), (uintptr_t)unwind_exception); _Unwind_SetGR(context, __builtin_eh_return_data_regno(1), results.ttypeIndex); _Unwind_SetIP(context, results.landingPad); |