Repository navigation
fix(executor): thread the list-abort through export/readonly OOB (#635) - #677
Merged
Merged
Conversation
export -a a=( [-2]=q ); echo AFTER printed AFTER rc 0; GNU diagnoses, no AFTER, rc 1 (same readonly -a). export -a/-A delegates to nested declare_builtin (setattr.def:240-268): arrayfunc.c:804-809 any_failed + DISCARD (subst.c:11169). Mirrors declare/local #658: apply arms record oob_word, keep partial store, stop the operand loop; Executor arms print the bare diagnostic, exit 1, raise the #637 evalerror abort. 13 new tests; 18/18 GNU probe matrix.
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.
fix(executor): thread the list-abort through export/readonly OOB (#635)
What
export -a a=( [-2]=q ); echo AFTERprintedAFTERwith rc 0; GNUprints the bad-subscript diagnostic, no
AFTER, rc 1 (same forreadonly -a).export -a/-Adelegates to nesteddeclare_builtin(
setattr.def:240-268), so OOB takes the declare path:arrayfunc.c:804-809err_badarraysub+any_failed+break, thenDISCARD (
subst.c:11169).Fix (mirrors declare/local #658 exactly)
apply_export_arg/apply_readonly_argtakeoob_word: &mut Option<String>: partial store+marks stay, FAILURE returned, noprint. Operand loops stop on OOB (later operands never run).
export/readonlyarms: bare<word>: bad array subscript(noexport:/readonly:segment),exit_code=1,evalerror_subscript_pending+raise_evalerror_abort(eval does not contain the assignment DISCARD jump (eval 'a[-2]=q' ends the whole script) #637, soevalcontains it), flush, return 1. Directexport()/readonly()wrappers print the bare diagnostic (noExecutor to abort through).
Verification
issue635_export_abort_regressions(13 tests).issue635_builtin_oob10,setattrunit 3,issue53415,
issue52815,array_store_parity2 — all pass.multi-op/eval/subshell/trap/in-range/success) byte-identical to GNU
(stdout+stderr+rc) 18/18.
except the new regression file itself (13/13, absent on master).
Test-level 4 NEW / 3 DISAPPEARED, all seven in the
known-nondeterministic
part_080coproc family (all pass in isolationon branch). No regression.
6295367, only rubash[patch]switched): 50 vs 49, the single extra
(
epochrealtime_beats_external_date_for_timing) is the known loadflake — fails 2/3 on master in isolation too.