diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-05-20 10:26:08 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-05-20 11:12:18 +0200 |
commit | 8819d247c68bd1b86959b3e7dfb66d54803c5d85 (patch) | |
tree | 99ac0023bc5e009f006aa6d1bb432f7ef54a9f3f /Zend/zend_execute_API.c | |
parent | c4badcbec473cb4d324c5b831870e25094b749e4 (diff) | |
download | php-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.
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r-- | Zend/zend_execute_API.c | 5 |
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); } } |