Repository navigation
fix(executor): propagate the redirect expansion-error verdict on the function fast path - #579
Merged
Merged
Conversation
…function fast path
execute_function_command_invocation's FatalNounset arm called
finish_heredoc_expansion_error and dropped its Result (spotted by
niubash's -D warnings lane). The classifier's Err is the GNU
run/continue verdict: an interactive session DISCARDs (subst.c:10416),
a noninteractive script FORCE_EOFs out of the main shell
(execute_cmd.c:5606) — dropping it kept the script running where GNU
stops (`set -u; f() { :; }; f <&$nope; echo after` printed `after`
with rc 0; GNU prints nothing, rc 1 in script mode and 127 via the -c
remap at shell.c:1471).
The classifier call stays scoped to the FatalNounset class — other
redirect rejections (bad dup fd, ambiguous redirect) keep the plain
skip path, pinned by the issue518 dup_empty_quoted_word probe.
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.
Companion to the niubash -D warnings lane (PRs #278/#283/#288/#289 all red on this one site).
The bug:
execute_function_command_invocation's FatalNounset arm calledfinish_heredoc_expansion_errorand dropped itsResult(unused_must_useunder-D warnings). The droppedErris not diagnostics noise — it is the GNU run/continue verdict: interactive sessions DISCARD (subst.c:10416), noninteractive scripts FORCE_EOF out of the main shell (execute_cmd.c:5606). Dropping it kept scripts running where GNU stops.Evidence (WSL GNU Bash 5.3, script-file probes):
set -u; f() { echo ran; }; f <&"$nope"; echo after— GNU:ran/afternever print, rc 1 (script) / 127 (the -c remap, shell.c:1471, already pinned bydash_c_mode_remaps_fatal_to_127). master:afterprints, rc 0. This PR: matches GNU in both modes.issue518_redirect_message_regressions::dup_empty_quoted_word_reports_bad_fd_with_raw_wordpins that an earlier draft of this fix broke it).Validation: full suite failure set bidirectionally identical to a fresh 40586ca master on this machine (comm empty both ways),
RUSTFLAGS="-D warnings" cargo checkgreen,cargo fmt --checkclean.