Fix keyed list destruct Undefined array key warning line (#31994) - #32024
Merged
Merged
Conversation
Stamp ArrayDimFetch opcodes with CFG source metadata so VM/JIT warnings cite the list destruct site instead of walking back to a prior ECHO opline. Co-authored-by: Cursor <cursoragent@cursor.com>
4 tasks
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
TYPE_ARRAY_DIM_FETCH/TYPE_ARRAY_DIM_FETCH_WRITEopcodes with CFGsourceLocationviaassignSourceMetadata()soUndefined array keywarnings cite the list-destructure fetch site (ZendZEND_FETCH_LIST_Ropline), not a prior statement such asecho.FatalSite::lineFromOpcodes()walked back to the precedingTYPE_ECHOfor keyed destruct after an earlier echo; positional destruct accidentally worked because an interveningTYPE_ASSIGNon the same line was found first..phpt+ dedicated VM/JIT test classes (Language: keyed list destructure Undefined array key Warning cites previous line — Zend list site (zend_vm_def.h) #31994).php-src reference
Zend/zend_vm_def.h—ZEND_FETCH_LIST_RZend/zend_execute.c—zend_undefined_indexuses current oplineVerification
Issue repro (VM):
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_list_undef_key_line.php 2>&1'Issue repro (JIT — falls back to VM interpreter when MCJIT verify fails on this script):
./script/docker-exec.sh -- bash -lc 'php bin/jit.php test/repro/maintainer_gap_list_undef_key_line.php 2>&1'Same output (key
"x"now line 5, was line 4).Compliance:
Both OK (1/1).
Not covered
VMTest/JITTestsuitesCloses #31994
Made with Cursor