summaryrefslogtreecommitdiff
path: root/Zend/zend_hash.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-07-02 18:43:06 +0800
committerXinchen Hui <laruence@php.net>2015-07-02 18:43:06 +0800
commit72b0627315e6606310c1042a51dad6e835620bab (patch)
treea15c4f11e5361607d663234af1c6afd97b61c6c0 /Zend/zend_hash.c
parent3422fb57c88cdb82868b845e0690569c376f080c (diff)
downloadphp-git-72b0627315e6606310c1042a51dad6e835620bab.tar.gz
Fixed bug #69521 (Segfault in gc_collect_cycles()).
Diffstat (limited to 'Zend/zend_hash.c')
-rw-r--r--Zend/zend_hash.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index a1cf8526d6..eb5081d56c 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -1218,8 +1218,11 @@ ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht)
IS_CONSISTENT(ht);
HT_ASSERT(GC_REFCOUNT(ht) <= 1);
- if (ht->nNumUsed) {
+ /* break possible cycles */
+ GC_REMOVE_FROM_BUFFER(ht);
+ GC_TYPE_INFO(ht) = IS_NULL | (GC_WHITE << 16);
+ if (ht->nNumUsed) {
/* In some rare cases destructors of regular arrays may be changed */
if (UNEXPECTED(ht->pDestructor != ZVAL_PTR_DTOR)) {
zend_hash_destroy(ht);