Language: nested-frame warnings cite inner opline not call site (#32040) - #32066
Merged
Merged
Conversation
ErrorReporter walked parent callSiteLine before the current opcode, so undefined-variable and float-mod deprecations inside functions/methods/closures cited the caller. Prefer this frame's opline, matching Zend execute_data. Co-authored-by: Cursor <cursoragent@cursor.com>
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
EG(current_execute_data)->opline).ErrorReporter::resolveDisplayLocation()walked parentcallSiteLinebefore the current frame's opline. Prefer this frame's pending FUNCCALL line, elseFatalSite::lineFromOpcodes(), then parent (builtins still attribute to the user call, Runtime: set_error_handler() callbacks receive empty $file and line 0 — Zend passes trigger site (Zend/zend_execute.c) #11163).Zend/zend_execute.c,Zend/zend_errors.c,Zend/zend_operators.c(mod_functionE_DEPRECATED). PHP implementation:lib/VM/ErrorReporter.php.Closes #32040
Test plan
./script/phpunit.sh --filter 'UndefinedVariableWarningLineTest|NestedFrameWarningLine32040|EncapsedUndefVarWarningLine32034'— OK (12 tests)chr(1.5)inside a function still cites thechr()line (call-site-of-builtin, not caller of the user function)Verification
php-src-strict. No new
runtime/*.c. Lane overflow from worker-lane-C (lane C IR was stdlib/ext-owned).Not covered: full
VMTest/JITTestsuites,script/differential-sweep.sh, AOT native emit of these repros.Made with Cursor