Repository navigation
Conversation
|
Hi @darkdi thanks for the patch but I m afraid the fix is really incorrect, I ll let ilaal review tough. |
|
Direction looks right: matching the immutable path lines up with the The And it is incomplete for mixed arrays with holes, where
Setting The |
aa8c24f to
4792857
Compare
|
Thanks, you were right on both. Reworked it the way you suggested: the exhausted cursor now goes to the new nNumUsed after compaction in both zend_array_dup_elements() and zend_hash_rehash(), not just copied. Built locally this time, your three rows plus packed with and without holes all give the appended element now, separated or not, and the new test fails on master for the holes cases. Zend/tests and ext/standard/tests/array pass |
|
@iliaal gentle ping on the Sep 11 revision. Does normalizing the exhausted cursor in both compaction paths address the cases you found? |
iliaal
left a comment
There was a problem hiding this comment.
Yes, that covers them. Please add a NEWS entry for the behaviour change.
|
AI-assisted reply:
|
… compaction zend_array_dup() reset an exhausted internal pointer to 0, and both it and zend_hash_rehash() left it at the old nNumUsed when holes were compacted, so a later append was either skipped or the pointer jumped back to the first element. Move it to the new end instead, the same way past-the-end iterators are already migrated. Signed-off-by: Dmitry Rantovov <rantovov5@gmail.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Puqi4fj3kWhLHanMyF1UNU
Signed-off-by: Dmitry Rantovov <rantovov5@gmail.com>
6956d52 to
e15bff3
Compare
An exhausted internal pointer now moves to the new end whenever holes get compacted, in
zend_array_dup()and inzend_hash_rehash(), the same way past-the-end iterators already do. The test covers packed and mixed, with and without holes, full table included, each with and without separation.Fixes GH-23617.