Skip to content

Commit e088ecb

Browse files
committed
Remove CE cache from non-interned file cache strings
1 parent 76e26c6 commit e088ecb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ext/opcache/zend_file_cache.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,21 @@ static int zend_file_cache_flock(int fd, int type)
134134
(ptr) = (void*)((char*)buf + (size_t)(ptr)); \
135135
} \
136136
} while (0)
137+
137138
#define SERIALIZE_STR(ptr) do { \
138139
if (ptr) { \
139140
if (IS_ACCEL_INTERNED(ptr)) { \
140141
(ptr) = zend_file_cache_serialize_interned((zend_string*)(ptr), info); \
141142
} else { \
142143
ZEND_ASSERT(IS_UNSERIALIZED(ptr)); \
144+
(ptr) = (void*)((char*)(ptr) - (char*)script->mem); \
145+
zend_string *__new_str = (zend_string*)((char*)buf + (uintptr_t)(ptr)); \
143146
/* script->corrupted shows if the script in SHM or not */ \
144147
if (EXPECTED(script->corrupted)) { \
145-
GC_ADD_FLAGS(ptr, IS_STR_INTERNED); \
146-
GC_DEL_FLAGS(ptr, IS_STR_PERMANENT); \
148+
GC_ADD_FLAGS(__new_str, IS_STR_INTERNED); \
149+
GC_DEL_FLAGS(__new_str, IS_STR_PERMANENT); \
147150
} \
148-
(ptr) = (void*)((char*)(ptr) - (char*)script->mem); \
151+
GC_DEL_FLAGS(__new_str, IS_STR_CLASS_NAME_MAP_PTR); \
149152
} \
150153
} \
151154
} while (0)

0 commit comments

Comments
 (0)