You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[compat] local/declare shadowing a readonly outer-scope var spuriously reports readonly variable #3609
area:builtinsbuiltin semantics (printf/declare/command/type/...)bugSomething isn't workinggnu-baselineTracked by the GNU Bash 5.3.0 true-baseline ledger
ccc(){ local x=(7 8 9); echo"ccc ${x[*]}"; }
ddd(){ local -r x='0'; ccc; }
x=zzz; ddd
GNU bash 5.3.20: ddd 0 then ccc 7 8 9 — silent.
rubash: same output plus spurious case.sh: line 2: x: readonly variable.
Root cause: the nested_readonly check in the declare-local operand binding consults the flat READONLY_VARS name mark without regard to whether the operand creates a FRESH local (locally_scoped). GNU make_local_variable (declare.def:929+, variables.c:5524+) binds the new mutable local instance; an outer-scope readonly mark on the same name must not fire. Same leakage made the readonly check reachable for the export/readonly family inside functions (those always bind the inherited global).
area:builtinsbuiltin semantics (printf/declare/command/type/...)bugSomething isn't workinggnu-baselineTracked by the GNU Bash 5.3.0 true-baseline ledger
Activity
caomengxuan666 commentedon Nov 16, 2026
已由 PR #3610 squash 合入 master:
841e125(完整 oid 841e125)。回归钉issue3609_local_readonly_shadow(5 格:1 格 headline 判别 + 4 格守卫)。fix(declare-local): skip readonly refusal when the operand creates a …
api(bind): add BindKindView::Keymap so the view reports keymap bindin…