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

Re: Strange parameter visibility



[> workers]

On Sat, Sep 17, 2016 at 9:37 PM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Sat, Sep 17, 2016 at 6:42 PM, Eric Cook <llua@xxxxxxx> wrote:
>>
>> It's a normal assignment just like the x=1. the weirdness is zsh
>> optimizing out a fork in the pipeline, so the scope of the
>> reassignment wasn't just a subshell.
>
> I have to conclude that's a bug -- it's OK to optimize out the fork,
> but not to optimize out its side effects (or cause new ones).

The addvars() that does this is exec.c:2847.  I tried copying the
save_/restore_params() wrapper from the nullexec branch near line 3455
(using !forked instead of POSIXBUILTINS as the test), but that results
in core dumps when running "make check".  Anybody with a better idea
what's going on here?



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