summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-05-20 10:26:08 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-05-20 11:12:18 +0200
commit8819d247c68bd1b86959b3e7dfb66d54803c5d85 (patch)
tree99ac0023bc5e009f006aa6d1bb432f7ef54a9f3f
parentc4badcbec473cb4d324c5b831870e25094b749e4 (diff)
downloadphp-git-8819d247c68bd1b86959b3e7dfb66d54803c5d85.tar.gz
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.
-rw-r--r--Zend/zend_execute_API.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 4277df1a1f..f2881f7054 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -287,8 +287,9 @@ void shutdown_executor(void) /* {{{ */
if (op_array->static_variables) {
HashTable *ht = ZEND_MAP_PTR_GET(op_array->static_variables_ptr);
if (ht) {
- ZEND_ASSERT(GC_REFCOUNT(ht) == 1);
- zend_array_destroy(ht);
+ if (!(GC_FLAGS(ht) & IS_ARRAY_IMMUTABLE) && GC_DELREF(ht) == 0) {
+ zend_array_destroy(ht);
+ }
ZEND_MAP_PTR_SET(op_array->static_variables_ptr, NULL);
}
}