Skip to content

Commit b55816e

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Don't set IS_STR_PERMANENT flag for strings stored in the file cache (php#15643)
2 parents bf98023 + afba201 commit b55816e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/opcache/zend_persist.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
#define zend_set_str_gc_flags(str) do { \
3939
GC_SET_REFCOUNT(str, 2); \
4040
uint32_t flags = GC_STRING | (ZSTR_IS_VALID_UTF8(str) ? IS_STR_VALID_UTF8 : 0); \
41-
if (file_cache_only) { \
41+
if (file_cache_only \
42+
|| (ZCG(current_persistent_script) && ZCG(current_persistent_script)->corrupted)) { \
43+
GC_TYPE_INFO(str) = GC_STRING | (IS_STR_INTERNED << GC_FLAGS_SHIFT); \
4244
flags |= (IS_STR_INTERNED << GC_FLAGS_SHIFT); \
4345
} else { \
4446
flags |= ((IS_STR_INTERNED | IS_STR_PERMANENT) << GC_FLAGS_SHIFT); \

0 commit comments

Comments
 (0)