|
|
|
@ -1025,12 +1025,17 @@ ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_fun |
|
|
|
{ |
|
|
|
Bucket *p; |
|
|
|
void *new_entry; |
|
|
|
zend_bool setTargetPointer; |
|
|
|
|
|
|
|
IS_CONSISTENT(source); |
|
|
|
IS_CONSISTENT(target); |
|
|
|
|
|
|
|
setTargetPointer = !target->pInternalPointer; |
|
|
|
p = source->pListHead; |
|
|
|
while (p) { |
|
|
|
if (setTargetPointer && source->pInternalPointer == p) { |
|
|
|
target->pInternalPointer = NULL; |
|
|
|
} |
|
|
|
if (p->nKeyLength == 0) { |
|
|
|
zend_hash_index_update(target, p->h, p->pData, size, &new_entry); |
|
|
|
} else { |
|
|
|
@ -1041,7 +1046,9 @@ ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_fun |
|
|
|
} |
|
|
|
p = p->pListNext; |
|
|
|
} |
|
|
|
target->pInternalPointer = target->pListHead; |
|
|
|
if (!target->pInternalPointer) { |
|
|
|
target->pInternalPointer = target->pListHead; |
|
|
|
} |
|
|
|
} |
|
|
|
/* }}} */ |
|
|
|
|
|
|
|
|