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

Re: All the way up or current scope



On Sun, May 18, 2025 at 2:32 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> The only cases that differ are those where pm->base is
> not initialized, and modulo the implementation of upscope() vs. your
> upscope2().  I suspect, but haven't confirmed, that the 4 places in
> typeset_single() where you initialize pm->upper could be factored out

Dug a bit deeper at this and noticed that (a) only three of the four
diffs to builtin.c actually modify pm->upper and (b) one of those is
useless because it's happening in an error case and (c) another is
dead code because of the surrounding (newspecial != NS_NONE) test.

The one that changes anything is when initializing a "typeset -nu ref"
... which isn't used in any of the comparisons in the Google doc.
Everything discussed so far, is down to upscope2() plus ignoring an
uninitialized pm->base.




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