Skip to content

Commit

Permalink
A workaround in libc++abi for failure to catch exceptions in an LTO b…
Browse files Browse the repository at this point in the history
…inary.

See yugabyte/yugabyte-db#13064 for details.
  • Loading branch information
mbautin committed Mar 25, 2024
1 parent 26a1d66 commit 0dee0e0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libcxxabi/src/cxa_personality.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,15 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
#endif // !__USING_SJLJ_EXCEPTIONS__ && !__USING_WASM_EXCEPTIONS__
} // there might be some tricky cases which break out of this loop

if (native_exception && actions == _UA_CLEANUP_PHASE) {
// This might happen for LTO binaries. Assume there is no handler and no
// cleanup needed in this stack frame, and continue unwinding the stack.
// We need to carefully test exception behavior with LTO.
// See https://github.com/yugabyte/yugabyte-db/issues/13064 for details.
results.reason = _URC_CONTINUE_UNWIND;
return;
}

// It is possible that no eh table entry specify how to handle
// this exception. By spec, terminate it immediately.
call_terminate(native_exception, unwind_exception);
Expand Down

0 comments on commit 0dee0e0

Please sign in to comment.