mirror of
https://git.code.sf.net/p/zsh/code
synced 2026-04-18 06:53:35 -04:00
53796: fix local reference chains and detect self-reference across local scopes
This commit is contained in:
committed by
Bart Schaefer
parent
e1fed5439c
commit
78b7629361
@@ -11,6 +11,9 @@
|
||||
omit base level for up-scope references; do not follow reference
|
||||
chains when computing base level of new references
|
||||
|
||||
* Philippe: 53796: Src/params.c, Test/K01nameref.ztst: fix local
|
||||
reference chains and detect self-reference across local scopes
|
||||
|
||||
2025-10-24 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* 54002: Src/parse.c: silence compiler warning for static function
|
||||
|
||||
@@ -6412,8 +6412,6 @@ setscope(Param pm)
|
||||
stop.name = pm->node.nam;
|
||||
stop.value.scalar = NULL;
|
||||
stop.flags = PM_NAMEREF;
|
||||
if (locallevel && !(pm->node.flags & PM_UPPER))
|
||||
stop.flags |= PM_LOCAL;
|
||||
dont_queue_signals(); /* Prevent unkillable loops */
|
||||
basepm = (Param)resolve_nameref(pm, &stop);
|
||||
restore_queue_signals(q);
|
||||
|
||||
@@ -1179,6 +1179,16 @@ F:previously this could create an infinite recursion and crash
|
||||
>typeset PS1=zz
|
||||
*?*
|
||||
|
||||
typeset -n ref1
|
||||
typeset -n ref2=ref1
|
||||
() {
|
||||
typeset -n ref3=ref2
|
||||
typeset ref2=foo
|
||||
ref1=ref3
|
||||
}
|
||||
1:self reference chain including a hidden reference
|
||||
?(anon):3: ref3: invalid self reference
|
||||
|
||||
zmodload -u zsh/random
|
||||
echo z=${(M)${(f)${ zmodload -ap}}:#*SRANDOM*}
|
||||
typeset -n ref=SRANDOM
|
||||
|
||||
Reference in New Issue
Block a user