From 4bfa26bb42c0e50be2f91fdfbdf8e4610dce68f5 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 29 Aug 2024 23:43:12 +0300 Subject: [PATCH] Don't set IS_STR_PERMANENT flag for strings stored in the file cache --- ext/opcache/zend_persist.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 8274af01942d2..8272e10be0aae 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -37,7 +37,8 @@ #define zend_set_str_gc_flags(str) do { \ GC_SET_REFCOUNT(str, 2); \ - if (file_cache_only) { \ + if (file_cache_only \ + || (ZCG(current_persistent_script) && ZCG(current_persistent_script)->corrupted)) { \ GC_TYPE_INFO(str) = GC_STRING | (IS_STR_INTERNED << GC_FLAGS_SHIFT); \ } else { \ GC_TYPE_INFO(str) = GC_STRING | ((IS_STR_INTERNED | IS_STR_PERMANENT) << GC_FLAGS_SHIFT); \