Skip to content

Commit

Permalink
Restore CE_CACHE clear on persist
Browse files Browse the repository at this point in the history
We still need to do this in case early binding succeeds and caches
the class. We could guard that by !in_compilation as well, but in
this case the previous cache clearing should be reliable, so
restore it.
  • Loading branch information
nikic committed Oct 5, 2021
1 parent 03e9bed commit e8e4852
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ext/opcache/zend_persist.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,9 @@ zend_class_entry *zend_persist_class_entry(zend_class_entry *orig_ce)
ce->inheritance_cache = NULL;

if (!(ce->ce_flags & ZEND_ACC_CACHED)) {
if (ZSTR_HAS_CE_CACHE(ce->name)) {
ZSTR_SET_CE_CACHE(ce->name, NULL);
}
zend_accel_store_interned_string(ce->name);
if (!(ce->ce_flags & ZEND_ACC_ANON_CLASS)
&& !ZCG(current_persistent_script)->corrupted) {
Expand Down

0 comments on commit e8e4852

Please sign in to comment.