Skip to content

Commit 02b5660

Browse files
committed
Clear ce cache when persisting for file cache only
We should clear the ce cache before storing the interned string, while we still have a reference to the original ce cache slot.
1 parent 57e2241 commit 02b5660

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ext/opcache/zend_persist.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -868,14 +868,13 @@ zend_class_entry *zend_persist_class_entry(zend_class_entry *orig_ce)
868868
ce->inheritance_cache = NULL;
869869

870870
if (!(ce->ce_flags & ZEND_ACC_CACHED)) {
871+
if (ZSTR_HAS_CE_CACHE(ce->name)) {
872+
ZSTR_SET_CE_CACHE(ce->name, NULL);
873+
}
871874
zend_accel_store_interned_string(ce->name);
872875
if (!(ce->ce_flags & ZEND_ACC_ANON_CLASS)
873876
&& !ZCG(current_persistent_script)->corrupted) {
874-
if (ZSTR_HAS_CE_CACHE(ce->name)) {
875-
ZSTR_SET_CE_CACHE(ce->name, NULL);
876-
} else {
877-
zend_accel_get_class_name_map_ptr(ce->name);
878-
}
877+
zend_accel_get_class_name_map_ptr(ce->name);
879878
}
880879
if (ce->parent_name && !(ce->ce_flags & ZEND_ACC_LINKED)) {
881880
zend_accel_store_interned_string(ce->parent_name);

0 commit comments

Comments
 (0)