Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
libcxxabi/src/cxa_exception.cpp
Show First 20 Lines • Show All 438 Lines • ▼ Show 20 Lines | __cxa_begin_catch(void* unwind_arg) throw() | ||||
// exception_header is a hackish offset from a foreign exception, but it | // exception_header is a hackish offset from a foreign exception, but it | ||||
// works as long as we're careful not to try to access any __cxa_exception | // works as long as we're careful not to try to access any __cxa_exception | ||||
// parts. | // parts. | ||||
__cxa_exception* exception_header = | __cxa_exception* exception_header = | ||||
cxa_exception_from_exception_unwind_exception | cxa_exception_from_exception_unwind_exception | ||||
( | ( | ||||
static_cast<_Unwind_Exception*>(unwind_exception) | static_cast<_Unwind_Exception*>(unwind_exception) | ||||
); | ); | ||||
#if defined(__MVS__) | |||||
// Remove the exception object from the linked list of exceptions that the z/OS unwinder | |||||
// maintains before adding it to the libc++abi list of caught exceptions. | |||||
// The libc++abi will manage the lifetime of the exception from this point forward. | |||||
_UnwindZOS_PopException(); | |||||
#endif | |||||
if (native_exception) | if (native_exception) | ||||
{ | { | ||||
// Increment the handler count, removing the flag about being rethrown | // Increment the handler count, removing the flag about being rethrown | ||||
exception_header->handlerCount = exception_header->handlerCount < 0 ? | exception_header->handlerCount = exception_header->handlerCount < 0 ? | ||||
-exception_header->handlerCount + 1 : exception_header->handlerCount + 1; | -exception_header->handlerCount + 1 : exception_header->handlerCount + 1; | ||||
// place the exception on the top of the stack if it's not already | // place the exception on the top of the stack if it's not already | ||||
// there by a previous rethrow | // there by a previous rethrow | ||||
if (exception_header != globals->caughtExceptions) | if (exception_header != globals->caughtExceptions) | ||||
▲ Show 20 Lines • Show All 314 Lines • Show Last 20 Lines |