Skip to content

Commit 2d3af7e

Browse files
committed
fix(opcache): only persist parametric-LSP property clones, not internal class props
Signed-off-by: azjezz <azjezz@protonmail.com>
1 parent 662497e commit 2d3af7e

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

ext/opcache/zend_persist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ zend_class_entry *zend_persist_class_entry(zend_class_entry *orig_ce)
12011201
zend_property_info *xlat_prop = zend_shared_alloc_get_xlat_entry(prop);
12021202
if (xlat_prop) {
12031203
Z_PTR(p->val) = xlat_prop;
1204-
} else if (!zend_accel_in_shm(prop)) {
1204+
} else if (prop->ce->type == ZEND_USER_CLASS && zend_hash_find_ptr(&prop->ce->properties_info, p->key) != prop) {
12051205
Z_PTR(p->val) = zend_persist_substituted_property_info(prop);
12061206
} else {
12071207
/* This can happen if preloading is used and we inherit a property from an

ext/opcache/zend_persist_calc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,9 @@ void zend_persist_class_entry_calc(zend_class_entry *ce)
662662
ADD_INTERNED_STRING(p->key);
663663
if (prop->ce == ce) {
664664
zend_persist_property_info_calc(prop);
665-
} else if (!zend_accel_in_shm(prop) && !zend_shared_alloc_get_xlat_entry(prop)) {
665+
} else if (prop->ce->type == ZEND_USER_CLASS
666+
&& !zend_shared_alloc_get_xlat_entry(prop)
667+
&& zend_hash_find_ptr(&prop->ce->properties_info, p->key) != prop) {
666668
zend_shared_alloc_register_xlat_entry(prop, prop);
667669
zend_persist_substituted_property_info_calc(prop);
668670
}

0 commit comments

Comments
 (0)