Fixed possible HashTable modification in its destructor

This commit is contained in:
Dmitry Stogov committed 2014-03-06 16:53:13 +04:00
1 parent dfe1fd73bf
commit 3e4c22b499
1 file changed
+8 -4
+8 -4
View File
@@ -508,13 +508,17 @@ static zend_always_inline void _zend_hash_del_el_ex(HashTable *ht, uint idx, Buc
}
}
}
if (ht->pDestructor) {
ht->pDestructor(&p->val);
}
if (p->key) {
STR_RELEASE(p->key);
}
Z_TYPE(p->val) = IS_UNDEF;
if (ht->pDestructor) {
zval tmp;
ZVAL_COPY_VALUE(&tmp, &p->val);
ZVAL_UNDEF(&p->val);
ht->pDestructor(&tmp);
} else {
ZVAL_UNDEF(&p->val);
}
}
static zend_always_inline void _zend_hash_del_el(HashTable *ht, uint idx, Bucket *p)