Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Fix crash on unset-through-nameref
- X-seq: zsh-workers 52667
- From: Stephane Chazelas <stephane@xxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Fix crash on unset-through-nameref
- Date: Mon, 4 Mar 2024 19:34:09 +0000
- Archived-at: <https://zsh.org/workers/52667>
- In-reply-to: <CAH+w=7b9dcQ4f=71rFZSWBVEJ4bzj7NxzD2-zoj2TkpaCkaCjw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- References: <CAH+w=7ayqWoufueuaHiCzjmzgHtv6VV0m7mEXoHn5nGq4pNOzg@mail.gmail.com> <20240304062914.kn6wquvgog3lefom@chazelas.org> <CAH+w=7b9dcQ4f=71rFZSWBVEJ4bzj7NxzD2-zoj2TkpaCkaCjw@mail.gmail.com>
2024-03-04 00:39:30 -0800, Bart Schaefer:
> On Sun, Mar 3, 2024 at 10:29 PM Stephane Chazelas <stephane@xxxxxxxxxxxx> wrote:
> >
> > That shows an unset through a nameref in a different scope
> > doesn't do a full unset
>
> Try removing this line from the patch:
>
> + pm->node.flags |= PM_DECLARED;
>
> If that works, it'll also require updating the test.
That helps a bit but:
$ ./Src/zsh -c 'myunset() { typeset -n v=$1; unset v; }; export x=1; myunset x; typeset -p x; x=2; typeset -p x'
export x=2
It still retained its export attribute.
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author