Repository navigation
executor: scan-mode substring parse probes via the non-reporting pre-scan (Refs #3225) - #3253
Merged
Merged
Conversation
caomengxuan666
marked this pull request as ready for review
November 10, 2026 11:55
This was referenced Nov 10, 2026
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.
Refs #3225
What changed
The parameter-expansion error pre-scan (a verdict-only pass layered over
the real expansion) parsed
${var:offset:length}substrings through theREPORTING element fetch, so a bad array subscript was printed once by the
scan's NULL probe (twice, via the operator-value error fallback) and once
more by the real expansion — three reports where GNU prints one
(subst.c:9777
parameter_brace_expandfetches the parameter once; thediagnostic itself is arrayfunc.c:1483
err_badarraysub).parameter_core.rs:parse_parameter_substringgains a scan-mode twin,parse_parameter_substring_for_scan, whose NULL probe derives from thenon-evaluating
pre_scan_operator_value(the same discipline theoperator arms already used). Only a provably-set parameter continues
the full parse; unset or undecidable shapes take the NULL shortcut,
which is verdict-equivalent for the scan's only question (the substring
error fires only for a non-NULL value). The real expansion path is
untouched.
parameter_errors.rs: the substring negative-length arm calls the scantwin;
pre_scan_operator_valuevisibility widened topub(in crate::executor).tests/issue1555_scalar_subscript_bad_subscript_regressions.rs:the existing combined pattern+substring cell already expected the GNU
count (2) and was red at 4 on the base; four new cells pin the substring
form alone (quoted / unquoted / real-array OOB), the non-literal
subscript substring forms plus the
i++side-effect count, the patternforms staying at one report, and the verdict set staying unchanged.
Evidence (Simular box, head 41cbc14, branch base 9ec0355)
the 16 cells (box log
fc3225-logs3/head-issue1555.log).exactly the pre-registered cells (the combined form, the substring
form, the non-literal substring form, the verdict cell); the pattern
cell is green on both sides.
issue3024 23/23, issue3063 22/22, issue755 11/11, issue772 6/6,
parameter_transform_tests 18/18 (see the note below).
failure name sets identical (empty on both sides).
cargo fmt --check: clean. Marker-literals lint: clean.-D warnings: the lib and this PR's pin target check clean. A full--all-targetscheck stops at one error that pre-dates this change —a dead helper at tests/issue2634_extdebug_bash_argc_sticky.rs:46,
reproduced identically on the base tree (test-hygiene face, unrelated
to this diff).
Note on parameter_transform_tests: run in a bare worktree whose target
dir lives outside the tree, all 18 cells fail at their output redirect
(
target/...-output.txt: No such file or directory) before anysemantics run; with the in-tree target dir present the stem passes
18/18 on the head. Recorded here so that red is not misread later.
Merge note
The branch base (9ec0355) pre-dates PR #3164 (landed as beab07d),
which touched the same two executor files in different functions;
expect a small same-file conflict surface at update-branch time.
本 PR 删除了什么
Nothing. No code or tests are removed: one probe call in the scan arm
is replaced by its scan-mode twin, one visibility is widened, and four
pin cells are added.