Skip to content

Commit acfc31c

Browse files
committed
Use zend_error_noreturn() for fatal errors
1 parent ac470dd commit acfc31c

18 files changed

+68
-68
lines changed

Zend/zend_API.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ ZEND_API int zend_parse_method_parameters(int num_args, zval *this_ptr, const ch
10201020
*object = this_ptr;
10211021

10221022
if (ce && !instanceof_function(Z_OBJCE_P(this_ptr), ce)) {
1023-
zend_error(E_CORE_ERROR, "%s::%s() must be derived from %s::%s",
1023+
zend_error_noreturn(E_CORE_ERROR, "%s::%s() must be derived from %s::%s",
10241024
Z_OBJCE_P(this_ptr)->name->val, get_active_function_name(), ce->name->val, get_active_function_name());
10251025
}
10261026

@@ -1057,7 +1057,7 @@ ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args, zval *this
10571057

10581058
if (ce && !instanceof_function(Z_OBJCE_P(this_ptr), ce)) {
10591059
if (!(flags & ZEND_PARSE_PARAMS_QUIET)) {
1060-
zend_error(E_CORE_ERROR, "%s::%s() must be derived from %s::%s",
1060+
zend_error_noreturn(E_CORE_ERROR, "%s::%s() must be derived from %s::%s",
10611061
ce->name->val, get_active_function_name(), Z_OBJCE_P(this_ptr)->name->val, get_active_function_name());
10621062
}
10631063
va_end(va);
@@ -1840,7 +1840,7 @@ ZEND_API int zend_startup_module_ex(zend_module_entry *module) /* {{{ */
18401840
if (module->module_startup_func) {
18411841
EG(current_module) = module;
18421842
if (module->module_startup_func(module->type, module->module_number)==FAILURE) {
1843-
zend_error(E_CORE_ERROR,"Unable to start %s module", module->name);
1843+
zend_error_noreturn(E_CORE_ERROR,"Unable to start %s module", module->name);
18441844
EG(current_module) = NULL;
18451845
return FAILURE;
18461846
}
@@ -2189,7 +2189,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
21892189
if (info->class_name) {
21902190
ZEND_ASSERT(info->type_hint == IS_OBJECT);
21912191
if (!scope && (!strcasecmp(info->class_name, "self") || !strcasecmp(info->class_name, "parent"))) {
2192-
zend_error(E_CORE_ERROR, "Cannot declare a return type of %s outside of a class scope", info->class_name);
2192+
zend_error_noreturn(E_CORE_ERROR, "Cannot declare a return type of %s outside of a class scope", info->class_name);
21932193
}
21942194
}
21952195

@@ -2399,15 +2399,15 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
23992399
}
24002400

24012401
if (ctor && ctor->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE && ctor->common.fn_flags & ZEND_ACC_CTOR) {
2402-
zend_error(E_CORE_ERROR, "Constructor %s::%s() cannot declare a return type", scope->name->val, ctor->common.function_name->val);
2402+
zend_error_noreturn(E_CORE_ERROR, "Constructor %s::%s() cannot declare a return type", scope->name->val, ctor->common.function_name->val);
24032403
}
24042404

24052405
if (dtor && dtor->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE && dtor->common.fn_flags & ZEND_ACC_DTOR) {
2406-
zend_error(E_CORE_ERROR, "Destructor %s::%s() cannot declare a return type", scope->name->val, dtor->common.function_name->val);
2406+
zend_error_noreturn(E_CORE_ERROR, "Destructor %s::%s() cannot declare a return type", scope->name->val, dtor->common.function_name->val);
24072407
}
24082408

24092409
if (clone && clone->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE && dtor->common.fn_flags & ZEND_ACC_DTOR) {
2410-
zend_error(E_CORE_ERROR, "%s::%s() cannot declare a return type", scope->name->val, clone->common.function_name->val);
2410+
zend_error_noreturn(E_CORE_ERROR, "%s::%s() cannot declare a return type", scope->name->val, clone->common.function_name->val);
24112411
}
24122412
efree((char*)lc_class_name);
24132413
}
@@ -3092,7 +3092,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
30923092
zend_spprintf(error, 0, "cannot call abstract method %s::%s()", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val);
30933093
retval = 0;
30943094
} else {
3095-
zend_error(E_ERROR, "Cannot call abstract method %s::%s()", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val);
3095+
zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val);
30963096
}
30973097
} else if (!fcc->object && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) {
30983098
int severity;
@@ -3636,7 +3636,7 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, z
36363636
case IS_ARRAY:
36373637
case IS_OBJECT:
36383638
case IS_RESOURCE:
3639-
zend_error(E_CORE_ERROR, "Internal zval's can't be arrays, objects or resources");
3639+
zend_error_noreturn(E_CORE_ERROR, "Internal zval's can't be arrays, objects or resources");
36403640
break;
36413641
default:
36423642
break;
@@ -3798,7 +3798,7 @@ ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, const
37983798
EG(scope) = scope;
37993799

38003800
if (!Z_OBJ_HT_P(object)->write_property) {
3801-
zend_error(E_CORE_ERROR, "Property %s of class %s cannot be updated", name, Z_OBJCE_P(object)->name->val);
3801+
zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be updated", name, Z_OBJCE_P(object)->name->val);
38023802
}
38033803
ZVAL_STRINGL(&property, name, name_length);
38043804
Z_OBJ_HT_P(object)->write_property(object, &property, value, NULL);
@@ -3976,7 +3976,7 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const c
39763976
EG(scope) = scope;
39773977

39783978
if (!Z_OBJ_HT_P(object)->read_property) {
3979-
zend_error(E_CORE_ERROR, "Property %s of class %s cannot be read", name, Z_OBJCE_P(object)->name->val);
3979+
zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be read", name, Z_OBJCE_P(object)->name->val);
39803980
}
39813981

39823982
ZVAL_STRINGL(&property, name, name_length);

Zend/zend_ast.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static void zend_ast_add_array_element(zval *result, zval *offset, zval *expr)
203203
zend_hash_index_update(Z_ARRVAL_P(result), zend_dval_to_lval(Z_DVAL_P(offset)), expr);
204204
break;
205205
default:
206-
zend_error(E_ERROR, "Illegal offset type");
206+
zend_error_noreturn(E_ERROR, "Illegal offset type");
207207
break;
208208
}
209209
}
@@ -338,7 +338,7 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
338338
zval_dtor(&op2);
339339
break;
340340
default:
341-
zend_error(E_ERROR, "Unsupported constant expression");
341+
zend_error_noreturn(E_ERROR, "Unsupported constant expression");
342342
}
343343
}
344344

Zend/zend_builtin_functions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1949,7 +1949,7 @@ ZEND_FUNCTION(create_function)
19491949

19501950
func = zend_hash_str_find_ptr(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME)-1);
19511951
if (!func) {
1952-
zend_error(E_ERROR, "Unexpected inconsistency in create_function()");
1952+
zend_error_noreturn(E_ERROR, "Unexpected inconsistency in create_function()");
19531953
RETURN_FALSE;
19541954
}
19551955
if (func->refcount) {

Zend/zend_closures.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ static void zend_closure_free_storage(zend_object *object) /* {{{ */
269269
zend_execute_data *ex = EG(current_execute_data);
270270
while (ex) {
271271
if (ex->func == &closure->func) {
272-
zend_error(E_ERROR, "Cannot destroy active lambda function");
272+
zend_error_noreturn(E_ERROR, "Cannot destroy active lambda function");
273273
}
274274
ex = ex->prev_execute_data;
275275
}

Zend/zend_compile.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4490,7 +4490,7 @@ static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_as
44904490
if (CG(current_import_function)) {
44914491
zend_string *import_name = zend_hash_find_ptr(CG(current_import_function), lcname);
44924492
if (import_name && !zend_string_equals_ci(lcname, import_name)) {
4493-
zend_error(E_COMPILE_ERROR, "Cannot declare function %s "
4493+
zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare function %s "
44944494
"because the name is already in use", name->val);
44954495
}
44964496
}
@@ -5229,7 +5229,7 @@ void zend_compile_const_decl(zend_ast *ast) /* {{{ */
52295229
&& (import_name = zend_hash_find_ptr(CG(current_import_const), name))
52305230
) {
52315231
if (!zend_string_equals(import_name, name)) {
5232-
zend_error(E_COMPILE_ERROR, "Cannot declare const %s because "
5232+
zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare const %s because "
52335233
"the name is already in use", name->val);
52345234
}
52355235
}
@@ -5499,7 +5499,7 @@ static zend_bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
54995499
zend_hash_update(Z_ARRVAL_P(result), STR_EMPTY_ALLOC(), value);
55005500
break;
55015501
default:
5502-
zend_error(E_COMPILE_ERROR, "Illegal offset type");
5502+
zend_error_noreturn(E_COMPILE_ERROR, "Illegal offset type");
55035503
break;
55045504
}
55055505
} else {

Zend/zend_constants.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,14 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
334334
if (scope) {
335335
ce = scope;
336336
} else {
337-
zend_error(E_ERROR, "Cannot access self:: when no class scope is active");
337+
zend_error_noreturn(E_ERROR, "Cannot access self:: when no class scope is active");
338338
}
339339
} else if (class_name_len == sizeof("parent")-1 &&
340340
!memcmp(lcname, "parent", sizeof("parent")-1)) {
341341
if (!scope) {
342-
zend_error(E_ERROR, "Cannot access parent:: when no class scope is active");
342+
zend_error_noreturn(E_ERROR, "Cannot access parent:: when no class scope is active");
343343
} else if (!scope->parent) {
344-
zend_error(E_ERROR, "Cannot access parent:: when current class scope has no parent");
344+
zend_error_noreturn(E_ERROR, "Cannot access parent:: when current class scope has no parent");
345345
} else {
346346
ce = scope->parent;
347347
}
@@ -350,7 +350,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
350350
if (EG(current_execute_data) && EG(current_execute_data)->called_scope) {
351351
ce = EG(current_execute_data)->called_scope;
352352
} else {
353-
zend_error(E_ERROR, "Cannot access static:: when no class scope is active");
353+
zend_error_noreturn(E_ERROR, "Cannot access static:: when no class scope is active");
354354
}
355355
} else {
356356
ce = zend_fetch_class(class_name, flags);
@@ -360,7 +360,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
360360
ret_constant = zend_hash_find(&ce->constants_table, constant_name);
361361
if (ret_constant == NULL) {
362362
if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) {
363-
zend_error(E_ERROR, "Undefined class constant '%s::%s'", class_name->val, constant_name->val);
363+
zend_error_noreturn(E_ERROR, "Undefined class constant '%s::%s'", class_name->val, constant_name->val);
364364
}
365365
} else if (Z_ISREF_P(ret_constant)) {
366366
ret_constant = Z_REFVAL_P(ret_constant);

Zend/zend_exceptions.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void zend_exception_set_previous(zend_object *exception, zend_object *add_previo
4848
}
4949
ZVAL_OBJ(&tmp, add_previous);
5050
if (!instanceof_function(Z_OBJCE(tmp), base_exception_ce)) {
51-
zend_error(E_ERROR, "Cannot set non exception as previous exception");
51+
zend_error_noreturn(E_ERROR, "Cannot set non exception as previous exception");
5252
return;
5353
}
5454
ZVAL_OBJ(&zv, exception);
@@ -116,7 +116,7 @@ ZEND_API void zend_throw_exception_internal(zval *exception) /* {{{ */
116116
if(EG(exception)) {
117117
zend_exception_error(EG(exception), E_ERROR);
118118
}
119-
zend_error(E_ERROR, "Exception thrown without a stack frame");
119+
zend_error_noreturn(E_ERROR, "Exception thrown without a stack frame");
120120
}
121121

122122
if (zend_throw_exception_hook) {
@@ -215,7 +215,7 @@ ZEND_METHOD(exception, __construct)
215215
int argc = ZEND_NUM_ARGS();
216216

217217
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "|SlO!", &message, &code, &previous, base_exception_ce) == FAILURE) {
218-
zend_error(E_ERROR, "Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]])");
218+
zend_error_noreturn(E_ERROR, "Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]])");
219219
}
220220

221221
object = getThis();
@@ -245,7 +245,7 @@ ZEND_METHOD(error_exception, __construct)
245245
size_t message_len, filename_len;
246246

247247
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "|sllslO!", &message, &message_len, &code, &severity, &filename, &filename_len, &lineno, &previous, base_exception_ce) == FAILURE) {
248-
zend_error(E_ERROR, "Wrong parameters for ErrorException([string $exception [, long $code, [ long $severity, [ string $filename, [ long $lineno [, Exception $previous = NULL]]]]]])");
248+
zend_error_noreturn(E_ERROR, "Wrong parameters for ErrorException([string $exception [, long $code, [ long $severity, [ string $filename, [ long $lineno [, Exception $previous = NULL]]]]]])");
249249
}
250250

251251
object = getThis();
@@ -972,13 +972,13 @@ ZEND_API void zend_throw_exception_object(zval *exception) /* {{{ */
972972
zend_class_entry *exception_ce;
973973

974974
if (exception == NULL || Z_TYPE_P(exception) != IS_OBJECT) {
975-
zend_error(E_ERROR, "Need to supply an object when throwing an exception");
975+
zend_error_noreturn(E_ERROR, "Need to supply an object when throwing an exception");
976976
}
977977

978978
exception_ce = Z_OBJCE_P(exception);
979979

980980
if (!exception_ce || !instanceof_function(exception_ce, base_exception_ce)) {
981-
zend_error(E_ERROR, "Exceptions must be valid objects derived from the Exception base class");
981+
zend_error_noreturn(E_ERROR, "Exceptions must be valid objects derived from the Exception base class");
982982
}
983983
zend_throw_exception_internal(exception);
984984
}

Zend/zend_execute.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ ZEND_API void zend_verify_internal_return_error(const zend_function *zf, const c
880880
fclass = "";
881881
}
882882

883-
zend_error(E_CORE_ERROR, "Return value of %s%s%s() must %s%s, %s%s returned",
883+
zend_error_noreturn(E_CORE_ERROR, "Return value of %s%s%s() must %s%s, %s%s returned",
884884
fclass, fsep, fname, need_msg, need_kind, returned_msg, returned_kind);
885885
}
886886

Zend/zend_execute_API.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
527527
char *colon;
528528

529529
if (IS_CONSTANT_VISITED(p)) {
530-
zend_error(E_ERROR, "Cannot declare self-referencing constant '%s'", Z_STRVAL_P(p));
530+
zend_error_noreturn(E_ERROR, "Cannot declare self-referencing constant '%s'", Z_STRVAL_P(p));
531531
} else if (Z_TYPE_P(p) == IS_CONSTANT) {
532532
int refcount;
533533

@@ -550,7 +550,7 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
550550
if ((colon = (char*)zend_memrchr(Z_STRVAL_P(p), ':', Z_STRLEN_P(p)))) {
551551
size_t len;
552552

553-
zend_error(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(p));
553+
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(p));
554554
len = Z_STRLEN_P(p) - ((colon - Z_STRVAL_P(p)) + 1);
555555
if (inline_change) {
556556
zend_string *tmp = zend_string_init(colon + 1, len, 0);
@@ -584,9 +584,9 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
584584
}
585585
if ((Z_CONST_FLAGS_P(p) & IS_CONSTANT_UNQUALIFIED) == 0) {
586586
if (save->val[0] == '\\') {
587-
zend_error(E_ERROR, "Undefined constant '%s'", save->val + 1);
587+
zend_error_noreturn(E_ERROR, "Undefined constant '%s'", save->val + 1);
588588
} else {
589-
zend_error(E_ERROR, "Undefined constant '%s'", save->val);
589+
zend_error_noreturn(E_ERROR, "Undefined constant '%s'", save->val);
590590
}
591591
if (inline_change) {
592592
zend_string_release(save);
@@ -698,7 +698,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
698698
case sizeof(zend_fcall_info):
699699
break; /* nothing to do currently */
700700
default:
701-
zend_error(E_ERROR, "Corrupted fcall_info provided to zend_call_function()");
701+
zend_error_noreturn(E_ERROR, "Corrupted fcall_info provided to zend_call_function()");
702702
break;
703703
}
704704

@@ -1182,7 +1182,7 @@ ZEND_API void zend_timeout(int dummy) /* {{{ */
11821182
zend_on_timeout(EG(timeout_seconds));
11831183
}
11841184

1185-
zend_error(E_ERROR, "Maximum execution time of %pd second%s exceeded", EG(timeout_seconds), EG(timeout_seconds) == 1 ? "" : "s");
1185+
zend_error_noreturn(E_ERROR, "Maximum execution time of %pd second%s exceeded", EG(timeout_seconds), EG(timeout_seconds) == 1 ? "" : "s");
11861186
}
11871187
/* }}} */
11881188

@@ -1224,7 +1224,7 @@ void zend_set_timeout(zend_long seconds, int reset_signals) /* {{{ */
12241224
if (!DeleteTimerQueueTimer(NULL, tq_timer, NULL)) {
12251225
EG(timed_out) = 0;
12261226
tq_timer = NULL;
1227-
zend_error(E_ERROR, "Could not delete queued timer");
1227+
zend_error_noreturn(E_ERROR, "Could not delete queued timer");
12281228
return;
12291229
}
12301230
tq_timer = NULL;
@@ -1234,7 +1234,7 @@ void zend_set_timeout(zend_long seconds, int reset_signals) /* {{{ */
12341234
if (!CreateTimerQueueTimer(&tq_timer, NULL, (WAITORTIMERCALLBACK)tq_timer_cb, (VOID*)&EG(timed_out), seconds*1000, 0, WT_EXECUTEONLYONCE)) {
12351235
EG(timed_out) = 0;
12361236
tq_timer = NULL;
1237-
zend_error(E_ERROR, "Could not queue new timer");
1237+
zend_error_noreturn(E_ERROR, "Could not queue new timer");
12381238
return;
12391239
}
12401240
EG(timed_out) = 0;
@@ -1283,7 +1283,7 @@ void zend_unset_timeout(void) /* {{{ */
12831283
if (!DeleteTimerQueueTimer(NULL, tq_timer, NULL)) {
12841284
EG(timed_out) = 0;
12851285
tq_timer = NULL;
1286-
zend_error(E_ERROR, "Could not delete queued timer");
1286+
zend_error_noreturn(E_ERROR, "Could not delete queued timer");
12871287
return;
12881288
}
12891289
tq_timer = NULL;
@@ -1319,20 +1319,20 @@ zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_type) /* {
13191319
switch (fetch_type) {
13201320
case ZEND_FETCH_CLASS_SELF:
13211321
if (!EG(scope)) {
1322-
zend_error(E_ERROR, "Cannot access self:: when no class scope is active");
1322+
zend_error_noreturn(E_ERROR, "Cannot access self:: when no class scope is active");
13231323
}
13241324
return EG(scope);
13251325
case ZEND_FETCH_CLASS_PARENT:
13261326
if (!EG(scope)) {
1327-
zend_error(E_ERROR, "Cannot access parent:: when no class scope is active");
1327+
zend_error_noreturn(E_ERROR, "Cannot access parent:: when no class scope is active");
13281328
}
13291329
if (!EG(scope)->parent) {
1330-
zend_error(E_ERROR, "Cannot access parent:: when current class scope has no parent");
1330+
zend_error_noreturn(E_ERROR, "Cannot access parent:: when current class scope has no parent");
13311331
}
13321332
return EG(scope)->parent;
13331333
case ZEND_FETCH_CLASS_STATIC:
13341334
if (!EG(current_execute_data) || !EG(current_execute_data)->called_scope) {
1335-
zend_error(E_ERROR, "Cannot access static:: when no class scope is active");
1335+
zend_error_noreturn(E_ERROR, "Cannot access static:: when no class scope is active");
13361336
}
13371337
return EG(current_execute_data)->called_scope;
13381338
case ZEND_FETCH_CLASS_AUTO: {
@@ -1348,11 +1348,11 @@ zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_type) /* {
13481348
if (use_autoload) {
13491349
if (!silent && !EG(exception)) {
13501350
if (fetch_type == ZEND_FETCH_CLASS_INTERFACE) {
1351-
zend_error(E_ERROR, "Interface '%s' not found", class_name->val);
1351+
zend_error_noreturn(E_ERROR, "Interface '%s' not found", class_name->val);
13521352
} else if (fetch_type == ZEND_FETCH_CLASS_TRAIT) {
1353-
zend_error(E_ERROR, "Trait '%s' not found", class_name->val);
1353+
zend_error_noreturn(E_ERROR, "Trait '%s' not found", class_name->val);
13541354
} else {
1355-
zend_error(E_ERROR, "Class '%s' not found", class_name->val);
1355+
zend_error_noreturn(E_ERROR, "Class '%s' not found", class_name->val);
13561356
}
13571357
}
13581358
}
@@ -1371,11 +1371,11 @@ zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval *
13711371
if (use_autoload) {
13721372
if ((fetch_type & ZEND_FETCH_CLASS_SILENT) == 0 && !EG(exception)) {
13731373
if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_INTERFACE) {
1374-
zend_error(E_ERROR, "Interface '%s' not found", class_name->val);
1374+
zend_error_noreturn(E_ERROR, "Interface '%s' not found", class_name->val);
13751375
} else if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_TRAIT) {
1376-
zend_error(E_ERROR, "Trait '%s' not found", class_name->val);
1376+
zend_error_noreturn(E_ERROR, "Trait '%s' not found", class_name->val);
13771377
} else {
1378-
zend_error(E_ERROR, "Class '%s' not found", class_name->val);
1378+
zend_error_noreturn(E_ERROR, "Class '%s' not found", class_name->val);
13791379
}
13801380
}
13811381
}
@@ -1432,7 +1432,7 @@ void zend_verify_abstract_class(zend_class_entry *ce) /* {{{ */
14321432
} ZEND_HASH_FOREACH_END();
14331433

14341434
if (ai.cnt) {
1435-
zend_error(E_ERROR, "Class %s contains %d abstract method%s and must therefore be declared abstract or implement the remaining methods (" MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT ")",
1435+
zend_error_noreturn(E_ERROR, "Class %s contains %d abstract method%s and must therefore be declared abstract or implement the remaining methods (" MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT ")",
14361436
ce->name->val, ai.cnt,
14371437
ai.cnt > 1 ? "s" : "",
14381438
DISPLAY_ABSTRACT_FN(0),

Zend/zend_generators.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ ZEND_API void zend_generator_resume(zend_generator *generator) /* {{{ */
303303
}
304304

305305
if (generator->flags & ZEND_GENERATOR_CURRENTLY_RUNNING) {
306-
zend_error(E_ERROR, "Cannot resume an already running generator");
306+
zend_error_noreturn(E_ERROR, "Cannot resume an already running generator");
307307
}
308308

309309
/* Drop the AT_FIRST_YIELD flag */

0 commit comments

Comments
 (0)