Skip to content

Commit 3b115e6

Browse files
committed
Fix zend_jit_class_may_be_modified() fon non linked classes
1 parent 33ba1a4 commit 3b115e6

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,21 +708,30 @@ static bool zend_jit_class_may_be_modified(const zend_class_entry *ce, const zen
708708
return 0;
709709
}
710710
if (ce->info.user.filename == called_from->filename) {
711-
if (ce->parent && zend_jit_class_may_be_modified(ce->parent, called_from)) {
711+
if (ce->parent
712+
&& (!(ce->ce_flags & ZEND_ACC_LINKED)
713+
|| zend_jit_class_may_be_modified(ce->parent, called_from))) {
712714
return 1;
713715
}
714716
if (ce->num_interfaces) {
717+
if (!(ce->ce_flags & ZEND_ACC_LINKED)) {
718+
return 1;
719+
}
715720
for (i = 0; i < ce->num_interfaces; i++) {
716721
if (zend_jit_class_may_be_modified(ce->interfaces[i], called_from)) {
717722
return 1;
718723
}
719724
}
720725
}
721726
if (ce->num_traits) {
727+
if (!(ce->ce_flags & ZEND_ACC_LINKED)) {
728+
return 1;
729+
}
722730
for (i=0; i < ce->num_traits; i++) {
723731
zend_class_entry *trait = zend_fetch_class_by_name(ce->trait_names[i].name,
724-
ce->trait_names[i].lc_name, ZEND_FETCH_CLASS_TRAIT);
725-
if (zend_jit_class_may_be_modified(trait, called_from)) {
732+
ce->trait_names[i].lc_name,
733+
ZEND_FETCH_CLASS_TRAIT | ZEND_FETCH_CLASS_NO_AUTOLOAD | ZEND_FETCH_CLASS_SILENT);
734+
if (!trait || zend_jit_class_may_be_modified(trait, called_from)) {
726735
return 1;
727736
}
728737
}

0 commit comments

Comments
 (0)