-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Fix GH-16053: array_merge_recursive(): convert_to_array() may need separation #16061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
zend_throw_error(NULL, "Recursion detected"); | ||
return 0; | ||
} | ||
|
||
ZEND_ASSERT(!Z_ISREF_P(dest_entry) || Z_REFCOUNT_P(dest_entry) > 1); | ||
SEPARATE_ZVAL(dest_entry); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this one (move it after convert_to_array
) because convert_to_array
will change dest_entry
itself, not its value.
This function needs some cleanup, as there are leftovers from previous refactorings. For instance I believe that src_entry == dest_entry
above is always false, and we don't use the result of ZVAL_DEREF(dest_zval)
because of dest_zval = dest_entry
below. However this is out of scope of this bug fix.
* PHP-8.2: [ci skip] NEWS for GH-16061
Fixes GH-16053