Leave no placeholder or empty entry in payload masks - #42
Merged
Merged
Conversation
Unwrapping the references seen once clears their mask slots to NULL, which dc_mask_cleanup() then strips, but only from the top-level mask: property, __unserialize() state and shared ref masks kept those placeholders. Clean them all after the unwrap pass. Shared references to scalars also added their UNDEF mask to refMasks, leaving an array that count() sees one element in but that iterates empty. Skip masks that are UNDEF as well as NULL.
nicolas-grekas
force-pushed
the
clean-masks
branch
from
September 23, 2026 15:04
4c50de6 to
bb0f917
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
deepclone_to_array()stripped thenullplaceholders left by unwrapping references seen once from the top-level mask only: property,__unserialize()state and shared ref masks kept them. Shared references to scalars also left an undefined entry inrefMasks, whichcount()sees but iteration doesn't:Payloads are now identical to the polyfill's, which I checked on the reference cases covered by symfony/polyfill#674.