Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Remove unnecessary tag based reference loop detection
- X-seq: zsh-workers 54277
- From: Philippe Altherr <philippe.altherr@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: [PATCH] Remove unnecessary tag based reference loop detection
- Date: Thu, 2 Apr 2026 22:52:54 +0100
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=w+l5srHDt/q9GHhvLvfmF9Jo/3z6M77QNEwIilNcU0Y=; fh=BgAYDYpL6Ne/A5nWEMVJiHiBtrz8Imz3uf26RDwgQX4=; b=NvStTb1RNBeAmUFUsvtXeNzLd6DzMZ38JV60MrVMC0z3qr/8xedByeUCuOnfDhfeYC 3aQ5+azeAErGuTji0jVKD7Hqxqhx9gPwkqUavivQ+o3LNB9Mryc1OQGNhzjdUP8fEg2b pwFA+0p/lGXFnQno3iaiHGcKMDAB9208FeHtk56eIJ8gO0OKpNmEpvaXo4MFcdyVDYww 2fHBd0wQJIZULwfqLtnyWctKBf5spLB5NmDJnQnOnWl0ur72m4OmQ/pA0Na7b17dXl0h 2ud7GdgRaK9Z5n85/D7WvkY1T6iTadL/1Ud0YnVkt/rWjofQHcoLNk2VofYR29jnqOkz Rv6w==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1775166786; cv=none; d=google.com; s=arc-20240605; b=TMan1mAQaejVZvPyT2mk28HOsQe5grb76Uy55veD9hJTohvb8GqNxhsd6QguPRXgI5 Cu1sr47rca3li7NiWkqrHURgkIXOxI6Q/W3N7BSgnLOEBCSK3Z8j1CAC/Mwk1UbKPsOz EzzrqzuoG3t3a6X/hQRG/D5RQvCsPrI8LX8jkKly3uoVjARgBVnrfTeae6RURR8nT1bS yN0/gY6nciJGgkwRHkDr92P40MOrUgiA/j2v/FzPtOU9b1CE5wl1Ml0Z8k1zt7cf0V85 /BHk4/IJenQ1Q1XInrbYMkooLbMo8/5sUFa3PC5W69g7IzXtvatBSC4kDFpNFRaFCzdY VejQ==
- Archived-at: <https://zsh.org/workers/54277>
- List-id: <zsh-workers.zsh.org>
With the latest changes, reference loops are always detected at creation time and undone in
getscope. The tag based loop detection is therefore no longer needed and can be removed.
Philippe
diff --git a/Src/params.c b/Src/params.c
index 461e02acf..ed1c566ea 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -6355,19 +6355,11 @@ resolve_nameref_rec(Param pm, const Param stop, int keep_lastref)
/* If present, it has to be the end of any chain, see fetchvalue() */
|| pm->width || !(refname = GETREFNAME(pm)) || !*refname)
return pm;
- if (pm->node.flags & PM_TAGGED) {
- zerr("%s: invalid self reference", pm->node.nam);
- return NULL;
- }
queue_signals();
if ((pm = (Param)gethashnode2(realparamtab, refname))) {
if ((pm = loadparamnode(paramtab, upscope(pm, ref), refname)) &&
- pm != stop && !(pm->node.flags & PM_UNSET)) {
- /* user can't tag a nameref, safe for loop detection */
- ref->node.flags |= PM_TAGGED;
+ pm != stop && !(pm->node.flags & PM_UNSET))
pm = resolve_nameref_rec(pm, stop, keep_lastref);
- ref->node.flags &= ~PM_TAGGED;
- }
} else if (keep_lastref)
pm = ref;
unqueue_signals();
Messages sorted by:
Reverse Date,
Date,
Thread,
Author