Stdlib: serialize() append-self-ref R: graph matches php-src (#22653)#22666
Merged
Conversation
Align php_add_var_hash: bump n for scalars/arrays without hashing them for R: lookup; key ISREF sets by shared target Variable so `$a=[1]; $a[]=&$a` re-emits the scalar and emits R:3 like Zend var.c. Co-authored-by: Cursor <cursoragent@cursor.com>
Closed
4 tasks
Owner
Author
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.
Summary
VmSerializewith php-srcphp_add_var_hash(ext/standard/var.c): scalars/arrays bump the stream index but are not stored forR:lookup; ISREF sets are keyed by the shared target Variable.$a=[1]; $a[]=&$aemittinga:2:{i:0;i:1;i:1;a:2:{i:0;i:1;i:1;R:3;}}(was wronglyR:2for the inner scalar).R:2), shared scalar/array refs, and objectR:/r:cases matching Zend.ext/standard/VmSerialize.php); JIT uses the same path viaSerializeJitHelper.Closes #22653
php-src reference
ext/standard/var.c—php_add_var_hash/php_var_serialize_intern(IS_REFERENCE → goto again)Verification
AOT note: exact circular repro needs
AssignRef(not implemented in AOT escape lowering). Host AOTserialize([1,1])also segfaults on current master (c:main_before_php) — pre-existing, not this diff. Shared helper will apply once AssignRef/AOT serialize runtime is healthy.Gates (pre-claim probe): inventory
OK 6454/6454;north-star5-fastred on master (gen-0 manifest mismatch #8713) — unrelated.Made with Cursor