summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_hash.c2
-rw-r--r--ext/opcache/zend_persist.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index a33818edef..681588bc9a 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -1831,7 +1831,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
GC_TYPE_INFO(target) = IS_ARRAY | (GC_COLLECTABLE << GC_FLAGS_SHIFT);
target->nTableSize = source->nTableSize;
- target->pDestructor = source->pDestructor;
+ target->pDestructor = ZVAL_PTR_DTOR;
if (source->nNumUsed == 0) {
HT_FLAGS(target) = (HT_FLAGS(source) & ~(HASH_FLAG_INITIALIZED|HASH_FLAG_PACKED)) | HASH_FLAG_STATIC_KEYS;
diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c
index 74015112e5..034067af09 100644
--- a/ext/opcache/zend_persist.c
+++ b/ext/opcache/zend_persist.c
@@ -89,6 +89,7 @@ static void zend_hash_persist(HashTable *ht, zend_persist_func_t pPersistElement
Bucket *p;
HT_FLAGS(ht) |= HASH_FLAG_STATIC_KEYS;
+ ht->pDestructor = NULL;
if (!(HT_FLAGS(ht) & HASH_FLAG_INITIALIZED)) {
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
@@ -175,6 +176,7 @@ static void zend_hash_persist_immutable(HashTable *ht)
Bucket *p;
HT_FLAGS(ht) |= HASH_FLAG_STATIC_KEYS;
+ ht->pDestructor = NULL;
if (!(HT_FLAGS(ht) & HASH_FLAG_INITIALIZED)) {
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);