Conversation
Zend attributes E_WARNING/E_DEPRECATED to EG(current_execute_data)->opline. ErrorReporter walked parent callSiteLine first, so diagnostics inside functions/methods/closures cited the DO_FCALL. Prefer this frame's opcode line (FatalSite), keep echo/print startLine on the opcode, and bake that site into JIT undef-var / float→int helpers. Co-authored-by: Cursor <cursoragent@cursor.com>
Owner
Author
|
Duplicate of #32066 (already merged, Closes #32040). Lane C overflow-claimed ~11m after this run's claim and landed the ErrorReporter opline fix first. This branch also had extra JIT/Compiler plumbing (echo |
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
f();,$obj->m(),$fn();) instead of Zend's inner opline (EG(current_execute_data)->oplineinZend/zend_execute.c).ErrorReporter::resolveDisplayLocationnow prefers this frame's pending FUNCCALL / current opcode (same order asFatalSite, Language: private(set) Error::getLine() is caller — Zend assignment line in method (zend_object_handlers.c) #29665) before walking parentcallSiteLine. Internal builtins still fall through to the user call site (Runtime: set_error_handler() callbacks receive empty $file and line 0 — Zend passes trigger site (Zend/zend_execute.c) #11163).sourceLocation; JIT bakes that line into undef-var and float→int helpers (no newruntime/*.c).php-src: Zend/zend_execute.c, Zend/zend_errors.c, Zend/zend_operators.c
mod_function.PHP implementation:
lib/VM/ErrorReporter.php,lib/Compiler.php,lib/JIT.php,lib/JIT/Helper.php,ext/standard/JitIntdiv.php.Closes #32040
Test plan
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_undef_var_function_line.php'— Warning on line 6 (Zend; not call line 8)./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_undef_var_method_line.php'— Warning on line 8 (not call line 11)./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_mod_float_closure_line.php'— Deprecated on line 5 (not$fn()line 7)./script/phpunit.sh --filter 'UndefinedVariableWarningLineTest|NestedFrameWarningLine32040|ErrorControlOperatorTest'— OK (15 tests)Made with Cursor