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 |
… 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
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 |
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.