mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
We should keep one refcount to resource
This commit is contained in:
parent
6815c08e29
commit
d5b78cec64
2 changed files with 12 additions and 10 deletions
|
@ -780,10 +780,11 @@ static void copy_constant_array(zval *dst, zval *src) /* {{{ */
|
|||
if (!Z_IMMUTABLE_P(val)) {
|
||||
copy_constant_array(new_val, val);
|
||||
}
|
||||
} else if (Z_TYPE_INFO_P(val) == IS_RESOURCE_EX) {
|
||||
Z_TYPE_INFO_P(new_val) &= ~(IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT);
|
||||
} else if (Z_REFCOUNTED_P(val)) {
|
||||
Z_ADDREF_P(val);
|
||||
if (UNEXPECTED(Z_TYPE_INFO_P(val) == IS_RESOURCE_EX)) {
|
||||
Z_TYPE_INFO_P(new_val) &= ~(IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT);
|
||||
}
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue