Lines Matching defs:ex

71                            struct __cxa_exception *ex,
83 if (ex)
85 ex->handlerSwitchValue = selector;
86 ex->catchTemp = landingPad;
95 struct __cxa_exception *ex,
104 if (ex)
106 *selector = ex->handlerSwitchValue;
107 *landingPad = reinterpret_cast<dw_eh_ptr_t>(ex->catchTemp);
114 static inline _Unwind_Reason_Code continueUnwinding(struct _Unwind_Exception *ex,
118 if (__gnu_unwind_frame(ex, context) != _URC_OK) { return _URC_FAILURE; }
283 static __cxa_exception *exceptionFromPointer(void *ex)
285 return reinterpret_cast<__cxa_exception*>(static_cast<char*>(ex) -
288 static __cxa_exception *realExceptionFromException(__cxa_exception *ex)
290 if (!isDependentException(ex->unwindHeader.exception_class)) { return ex; }
291 return reinterpret_cast<__cxa_exception*>((reinterpret_cast<__cxa_dependent_exception*>(ex))->primaryException)-1;
335 __cxa_exception *ex = globals->caughtExceptions;
337 if (ex != nullptr) {
338 fprintf(stderr, "Terminating due to uncaught exception %p", static_cast<void*>(ex));
339 ex = realExceptionFromException(ex);
343 dynamic_cast<const __class_type_info*>(ex->exceptionType);
347 static_cast<std::exception*>(e_ti->cast_to(static_cast<void*>(ex+1), throw_ti));
356 const char *mangled = ex->exceptionType->name();
385 struct _Unwind_Exception *ex)
391 __cxa_free_exception(static_cast<void*>(ex + 1));
394 struct _Unwind_Exception *ex)
397 __cxa_free_dependent_exception(static_cast<void*>(ex + 1));
403 static void free_exception_list(__cxa_exception *ex)
405 if (0 != ex->nextException)
407 free_exception_list(ex->nextException);
411 __cxa_free_exception(ex+1);
703 __cxa_exception *ex = reinterpret_cast<__cxa_exception*>(thrown_exception) - 1;
705 if (0 != ex->exceptionDestructor)
709 ex->exceptionDestructor(thrown_exception);
718 free_exception(reinterpret_cast<char*>(ex));
739 __cxa_dependent_exception *ex = reinterpret_cast<__cxa_dependent_exception*>(thrown_exception) - 1;
740 assert(isDependentException(ex->unwindHeader.exception_class));
741 if (ex->primaryException)
743 releaseException(realExceptionFromException(reinterpret_cast<__cxa_exception*>(ex)));
745 free_exception(reinterpret_cast<char*>(ex));
780 static void throw_exception(__cxa_exception *ex)
783 ex->unexpectedHandler = info->unexpectedHandler;
784 if (0 == ex->unexpectedHandler)
786 ex->unexpectedHandler = unexpectedHandler.load();
788 ex->terminateHandler = info->terminateHandler;
789 if (0 == ex->terminateHandler)
791 ex->terminateHandler = terminateHandler.load();
795 _Unwind_Reason_Code err = _Unwind_RaiseException(&ex->unwindHeader);
799 report_failure(err, ex);
804 __cxa_exception *ex = reinterpret_cast<__cxa_exception*>(object) - 1;
806 ex->referenceCount = 0;
807 ex->exceptionType = tinfo;
809 ex->exceptionDestructor = dest;
811 ex->unwindHeader.exception_class = exception_class;
812 ex->unwindHeader.exception_cleanup = exception_cleanup;
814 return ex;
827 __cxa_exception *ex = __cxa_init_primary_exception(thrown_exception, tinfo, dest);
828 ex->referenceCount = 1;
830 throw_exception(ex);
838 __cxa_dependent_exception *ex = reinterpret_cast<__cxa_dependent_exception*>(__cxa_allocate_dependent_exception())-1;
840 ex->primaryException = thrown_exception;
843 ex->exceptionType = original->exceptionType;
844 ex->unwindHeader.exception_class = dependent_exception_class;
845 ex->unwindHeader.exception_cleanup = dependent_exception_cleanup;
847 throw_exception(reinterpret_cast<__cxa_exception*>(ex));
853 __cxa_exception *ex = globals->caughtExceptions;
855 if (0 == ex) { return NULL; }
856 ex = realExceptionFromException(ex);
857 __sync_fetch_and_add(&ex->referenceCount, 1);
858 return ex + 1;
864 __cxa_exception *ex = static_cast<__cxa_exception*>(thrown_exception) - 1;
865 if (isDependentException(ex->unwindHeader.exception_class)) { return; }
866 __sync_fetch_and_add(&ex->referenceCount, 1);
871 __cxa_exception *ex = static_cast<__cxa_exception*>(thrown_exception) - 1;
872 releaseException(ex);
891 __cxa_exception *ex = globals->caughtExceptions;
893 if (0 == ex)
903 _Unwind_Exception *e = reinterpret_cast<_Unwind_Exception*>(ex);
905 report_failure(err, ex);
909 assert(ex->handlerCount > 0 && "Rethrowing uncaught exception!");
918 // ex->handlerCount will be decremented in __cxa_end_catch in enclosing
924 ex->handlerCount = -ex->handlerCount;
930 _Unwind_Reason_Code err = _Unwind_Resume_or_Rethrow(&ex->unwindHeader);
931 report_failure(err, ex);
961 * object. If ex is 0 then it is assumed to be a foreign exception and only
964 static bool check_type_signature(__cxa_exception *ex,
968 void *exception_ptr = static_cast<void*>(ex+1);
969 const std::type_info *ex_type = ex ? ex->exceptionType : 0;
971 bool is_ptr = ex ? ex_type->__is_pointer_p() : false;
982 if (ex)
989 if (0 == ex) { return false; }
1018 __cxa_exception *ex,
1036 if (check_type_signature(ex, handler_type, adjustedPtr))
1042 else if (filter < 0 && 0 != ex)
1051 if (check_type_signature(ex, handler_type, adjustedPtr))
1066 if (check_type_signature(ex, handler_type, adjustedPtr))
1089 __cxa_exception *ex)
1093 if (ex)
1095 ex->cleanupCount++;
1096 if (ex->cleanupCount > 1)
1101 ex->nextCleanup = info->currentCleanup;
1121 __cxa_exception *ex = 0;
1132 ex = exceptionFromPointer(exceptionObject);
1133 realEx = realExceptionFromException(ex);
1181 action.action_record, realEx, &selector, ex->adjustedPtr);
1188 if (ex)
1190 saveLandingPad(context, exceptionObject, ex, selector, action.landing_pad);
1191 ex->languageSpecificData = reinterpret_cast<const char*>(lsda_addr);
1192 ex->actionRecord = reinterpret_cast<const char*>(action.action_record);
1193 // ex->adjustedPtr is set when finding the action record.
1212 action.action_record, realEx, &selector, ex->adjustedPtr);
1215 pushCleanupException(exceptionObject, ex);
1222 &selector, ex->adjustedPtr);
1224 else if (ex->catchTemp == 0)
1232 loadLandingPad(context, exceptionObject, ex, &selector, &action.landing_pad);
1233 ex->catchTemp = 0;
1234 ex->handlerSwitchValue = 0;
1270 __cxa_exception *ex = exceptionFromPointer(exceptionObject);
1272 if (ex->handlerCount == 0)
1277 ex->nextException = globals->caughtExceptions;
1278 globals->caughtExceptions = ex;
1281 if (ex->handlerCount < 0)
1301 ex->handlerCount = -ex->handlerCount + 1;
1305 ex->handlerCount++;
1309 return ex->adjustedPtr;
1340 __cxa_exception *ex = globals->caughtExceptions;
1342 assert(0 != ex && "Ending catch when no exception is on the stack!");
1359 if (ex->handlerCount < 0)
1377 ex->handlerCount++;
1382 ex->handlerCount--;
1385 if (ex->handlerCount == 0)
1387 globals->caughtExceptions = ex->nextException;
1390 releaseException(ex);
1401 __cxa_exception *ex = globals->caughtExceptions;
1402 return ex ? ex->exceptionType : 0;
1429 __cxa_exception *ex = exceptionFromPointer(exceptionObject);
1430 if (ex->unexpectedHandler)
1432 ex->unexpectedHandler();
1612 __cxa_exception *ex = exceptionFromPointer(exceptionObject);
1613 ex->cleanupCount--;
1614 if (ex->cleanupCount == 0)
1616 info->currentCleanup = ex->nextCleanup;
1617 ex->nextCleanup = 0;