Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Remove unnecessary tag based reference loop detection



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.

- Remove unnecessary tag based reference loop detection

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