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

Re: [PATCH] Eliminate getparamnode() and the distinction between getnode() and getnode2()



On Fri, Sep 18, 2026 at 7:54 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
index e8a6b6422..0ac758fbe 100644
--- a/Src/Zle/compresult.c
+++ b/Src/Zle/compresult.c
@@ -1082,7 +1082,7 @@ do_single(Cmatch m)
  } else
     n = p + 1;

- if ((pm = (Param) realparamtab->getnode(realparamtab, n)) &&
+ if ((pm = resolveparam(n, 1)) ||
     PM_TYPE(pm->node.flags) != PM_SCALAR)
     tryit = 0;
     }

This will surely crash when pm is NULL and you access pm->node?

Good catch. That's obviously wrong. No clue why I replaced && with ||. Just in case, I checked whether the patch contains other similar bogus changes but I didn't see any.

I will update the patch when I update workers/55145.

Philippe



Messages sorted by: Reverse Date, Date, Thread, Author