Skip to content

Commit 8819d24

Browse files
committed
Don't require rc=1 for function static variables
If file cache only is used, then static_variables_ptr may point to an immutable static_variables HT, which we do not want to destroy here.
1 parent c4badcb commit 8819d24

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Zend/zend_execute_API.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,9 @@ void shutdown_executor(void) /* {{{ */
287287
if (op_array->static_variables) {
288288
HashTable *ht = ZEND_MAP_PTR_GET(op_array->static_variables_ptr);
289289
if (ht) {
290-
ZEND_ASSERT(GC_REFCOUNT(ht) == 1);
291-
zend_array_destroy(ht);
290+
if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && GC_DELREF(ht) == 0) {
291+
zend_array_destroy(ht);
292+
}
292293
ZEND_MAP_PTR_SET(op_array->static_variables_ptr, NULL);
293294
}
294295
}

0 commit comments

Comments
 (0)