Skip to content

Commit d9eb960

Browse files
committed
Fixes
1 parent 4af9a2d commit d9eb960

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

Zend/zend_execute.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,11 @@ ZEND_COLD zend_never_inline void zend_verify_class_constant_type_error(const zen
832832
{
833833
zend_string *type_str = zend_type_to_string(c->type);
834834

835+
/* we _may_ land here in case reading already errored and runtime cache thus has not been updated (i.e. it contains a valid but unrelated info) */
836+
if (EG(exception)) {
837+
return;
838+
}
839+
835840
zend_type_error("Cannot assign %s to class constant %s::%s of type %s",
836841
zend_zval_type_name(constant), ZSTR_VAL(c->ce->name), ZSTR_VAL(c->name), ZSTR_VAL(type_str));
837842

Zend/zend_vm_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5948,6 +5948,7 @@ ZEND_VM_HANDLER(181, ZEND_FETCH_CLASS_CONSTANT, VAR|CONST|UNUSED|CLASS_FETCH, CO
59485948
if (UNEXPECTED(!(c->ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED))) {
59495949
if (UNEXPECTED(zend_update_class_constants(c->ce)) != SUCCESS) {
59505950
ZVAL_UNDEF(EX_VAR(opline->result.var));
5951+
FREE_OP2();
59515952
HANDLE_EXCEPTION();
59525953
}
59535954
}
@@ -5970,7 +5971,6 @@ ZEND_VM_HANDLER(181, ZEND_FETCH_CLASS_CONSTANT, VAR|CONST|UNUSED|CLASS_FETCH, CO
59705971
}
59715972
}
59725973
if (OP2_TYPE == IS_CONST) {
5973-
value = &c->value;
59745974
CACHE_POLYMORPHIC_PTR(opline->extended_value, ce, value);
59755975
}
59765976
} else {

Zend/zend_vm_execute.h

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)