From 78b7629361b63c3914edc6c77af57246b2d183a3 Mon Sep 17 00:00:00 2001 From: Philippe Altherr Date: Sun, 26 Oct 2025 17:05:44 -0700 Subject: 53796: fix local reference chains and detect self-reference across local scopes --- Test/K01nameref.ztst | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Test') diff --git a/Test/K01nameref.ztst b/Test/K01nameref.ztst index b03487d03..49a9a9d4d 100644 --- a/Test/K01nameref.ztst +++ b/Test/K01nameref.ztst @@ -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