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 Sep 22, 2023
1 parent e19b7dc commit 4b8dfdb
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 @@ -852,6 +852,15 @@ static void scan_eh_tab(scan_results &results, _Unwind_Action actions,
#endif // !__USING_SJLJ_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 4b8dfdb

Please sign in to comment.