Lines Matching refs:exception
96 void zend_exception_set_previous(zend_object *exception, zend_object *add_previous) /* {{{ */ in zend_exception_set_previous() argument
102 if (!exception || !add_previous) { in zend_exception_set_previous()
106 …if (exception == add_previous || zend_is_unwind_exit(add_previous) || zend_is_graceful_exit(add_pr… in zend_exception_set_previous()
115 ZVAL_OBJ(&zv, exception); in zend_exception_set_previous()
144 zend_exception_set_previous(EG(exception), EG(prev_exception)); in zend_exception_save()
146 if (EG(exception)) { in zend_exception_save()
147 EG(prev_exception) = EG(exception); in zend_exception_save()
149 EG(exception) = NULL; in zend_exception_save()
156 if (EG(exception)) { in zend_exception_restore()
157 zend_exception_set_previous(EG(exception), EG(prev_exception)); in zend_exception_restore()
159 EG(exception) = EG(prev_exception); in zend_exception_restore()
174 ZEND_API ZEND_COLD void zend_throw_exception_internal(zend_object *exception) /* {{{ */ in zend_throw_exception_internal() argument
178 if (exception != NULL) { in zend_throw_exception_internal()
179 DTRACE_EXCEPTION_THROWN(ZSTR_VAL(exception->ce->name)); in zend_throw_exception_internal()
186 if (exception != NULL) { in zend_throw_exception_internal()
187 zend_object *previous = EG(exception); in zend_throw_exception_internal()
190 OBJ_RELEASE(exception); in zend_throw_exception_internal()
194 zend_exception_set_previous(exception, EG(exception)); in zend_throw_exception_internal()
195 EG(exception) = exception; in zend_throw_exception_internal()
202 …if (exception && (exception->ce == zend_ce_parse_error || exception->ce == zend_ce_compile_error))… in zend_throw_exception_internal()
205 if (EG(exception)) { in zend_throw_exception_internal()
207 && !zend_is_unwind_exit(EG(exception)) in zend_throw_exception_internal()
208 && !zend_is_graceful_exit(EG(exception))) { in zend_throw_exception_internal()
210 if (EG(exception)) { in zend_throw_exception_internal()
211 zend_exception_error(EG(exception), E_ERROR); in zend_throw_exception_internal()
215 zend_exception_error(EG(exception), E_ERROR); in zend_throw_exception_internal()
223 zend_throw_exception_hook(exception); in zend_throw_exception_internal()
237 zend_object *exception; in zend_clear_exception() local
242 if (!EG(exception)) { in zend_clear_exception()
246 exception = EG(exception); in zend_clear_exception()
247 EG(exception) = NULL; in zend_clear_exception()
248 OBJ_RELEASE(exception); in zend_clear_exception()
628 if (EG(exception)) { in ZEND_METHOD()
652 zval trace, *exception; in ZEND_METHOD() local
663 exception = ZEND_THIS; in ZEND_METHOD()
666 …while (exception && Z_TYPE_P(exception) == IS_OBJECT && instanceof_function(Z_OBJCE_P(exception), … in ZEND_METHOD()
668 zend_string *message = zval_get_string(GET_PROPERTY(exception, ZEND_STR_MESSAGE)); in ZEND_METHOD()
669 zend_string *file = zval_get_string(GET_PROPERTY(exception, ZEND_STR_FILE)); in ZEND_METHOD()
670 zend_long line = zval_get_long(GET_PROPERTY(exception, ZEND_STR_LINE)); in ZEND_METHOD()
674 fci.object = Z_OBJ_P(exception); in ZEND_METHOD()
687 …if ((Z_OBJCE_P(exception) == zend_ce_type_error || Z_OBJCE_P(exception) == zend_ce_argument_count_… in ZEND_METHOD()
697 zend_string *name = Z_OBJCE_P(exception)->name; in ZEND_METHOD()
718 Z_PROTECT_RECURSION_P(exception); in ZEND_METHOD()
719 exception = GET_PROPERTY(exception, ZEND_STR_PREVIOUS); in ZEND_METHOD()
720 ZVAL_DEREF(exception); in ZEND_METHOD()
721 if (Z_TYPE_P(exception) == IS_OBJECT && Z_IS_RECURSIVE_P(exception)) { in ZEND_METHOD()
727 exception = ZEND_THIS; in ZEND_METHOD()
729 …hile (Z_TYPE_P(exception) == IS_OBJECT && (base_ce = i_get_exception_base(Z_OBJ_P(exception))) && … in ZEND_METHOD()
730 if (Z_IS_RECURSIVE_P(exception)) { in ZEND_METHOD()
731 Z_UNPROTECT_RECURSION_P(exception); in ZEND_METHOD()
735 exception = GET_PROPERTY(exception, ZEND_STR_PREVIOUS); in ZEND_METHOD()
736 ZVAL_DEREF(exception); in ZEND_METHOD()
739 exception = ZEND_THIS; in ZEND_METHOD()
740 base_ce = i_get_exception_base(Z_OBJ_P(exception)); in ZEND_METHOD()
745 zend_update_property_ex(base_ce, Z_OBJ_P(exception), ZSTR_KNOWN(ZEND_STR_STRING), &tmp); in ZEND_METHOD()
901 zval exception, rv; in zend_exception_error() local
905 ZVAL_OBJ(&exception, ex); in zend_exception_error()
907 EG(exception) = NULL; in zend_exception_error()
909 zend_string *message = zval_get_string(GET_PROPERTY(&exception, ZEND_STR_MESSAGE)); in zend_exception_error()
910 zend_string *file = zval_get_string(GET_PROPERTY_SILENT(&exception, ZEND_STR_FILE)); in zend_exception_error()
911 zend_long line = zval_get_long(GET_PROPERTY_SILENT(&exception, ZEND_STR_LINE)); in zend_exception_error()
925 if (!EG(exception)) { in zend_exception_error()
934 if (EG(exception)) { in zend_exception_error()
937 ZVAL_OBJ(&zv, EG(exception)); in zend_exception_error()
953 str = zval_get_string(GET_PROPERTY_SILENT(&exception, ZEND_STR_STRING)); in zend_exception_error()
954 file = zval_get_string(GET_PROPERTY_SILENT(&exception, ZEND_STR_FILE)); in zend_exception_error()
955 line = zval_get_long(GET_PROPERTY_SILENT(&exception, ZEND_STR_LINE)); in zend_exception_error()
981 ZEND_ASSERT(EG(exception)); in zend_exception_uncaught_error()
983 ZVAL_OBJ_COPY(&exception_zv, EG(exception)); in zend_exception_uncaught_error()
991 ZEND_API ZEND_COLD void zend_throw_exception_object(zval *exception) /* {{{ */ in zend_throw_exception_object() argument
993 if (exception == NULL || Z_TYPE_P(exception) != IS_OBJECT) { in zend_throw_exception_object()
997 zend_class_entry *exception_ce = Z_OBJCE_P(exception); in zend_throw_exception_object()
1001 zval_ptr_dtor(exception); in zend_throw_exception_object()
1005 zend_throw_exception_internal(Z_OBJ_P(exception)); in zend_throw_exception_object()
1021 ZEND_ASSERT(!EG(exception)); in zend_throw_unwind_exit()
1022 EG(exception) = zend_create_unwind_exit(); in zend_throw_unwind_exit()
1029 ZEND_ASSERT(!EG(exception)); in zend_throw_graceful_exit()
1030 EG(exception) = zend_create_graceful_exit(); in zend_throw_graceful_exit()