Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Segmentation fault immediately after 'unset PATH'
- X-seq: zsh-workers 44510
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: <zsh-workers@xxxxxxx>
- Subject: Re: Segmentation fault immediately after 'unset PATH'
- Date: Thu, 11 Jul 2019 11:58:50 +0100
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190711105853euoutp016edad585911a5b3cfa9290a32e215abe~wVS_rm6Kt2481524815euoutp01G
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1562842733; bh=bRGBSwmaAus5roa4V3O6i/ZhmWFktmAV6M2bBz/0ELo=; h=Subject:From:To:Date:In-Reply-To:References:From; b=Ea0PGAh+5GyV9ub8mne7nhCiu7MmQFx5IMpONq/Frx87jJaVHhAeYD5fRrz6aTux9 GFbxo3/exvTsSdpZDcIU6OalMDfKSZqQ6Uxulj0KEZt2NgAUXfjlpjn6mk47IZ86dp Z5w76YgI4U8nXs8P4O4MeABX+2S4L4zAqz4SinBw=
- In-reply-to: <1562842103.4950.12.camel@samsung.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAPkN6ar45kY-bu=XBs-feUx2R4UFh1d2E6m7rZrbAAKm+3sd1A@mail.gmail.com> <CGME20190710215257epcas2p3150c3096788c5d5a56e212b9e7067f19@epcas2p3.samsung.com> <CAHYJk3Te=EKxLh3Wo0fbFn2awx2d8sc8HwoZihQqwd6mik8svg@mail.gmail.com> <1562834672.4950.2.camel@samsung.com> <1562842103.4950.12.camel@samsung.com>
On Thu, 2019-07-11 at 11:48 +0100, Peter Stephenson wrote:
> diff --git a/Src/params.c b/Src/params.c
> index 1859c7c12..95181f533 100644
> --- a/Src/params.c
> +++ b/Src/params.c
> @@ -3617,10 +3617,18 @@ unsetparam_pm(Param pm, int altflag, int exp)
> altpm = (Param) paramtab->getnode(paramtab, altremove);
> /* tied parameters are at the same local level as each other */
> oldpm = NULL;
> - while (altpm && altpm->level > pm->level) {
> - /* param under alternate name hidden by a local */
> - oldpm = altpm;
> - altpm = altpm->old;
> + /*
> + * Look for param under alternate name hidden by a local.
> + * If this parameter is special, however, the visible
> + * parameter is the special and the hidden one is keeping
> + * and old value --- we just mark the visible one as unset.
> + */
> + if (altpm && !(altpm->node.flags & PM_SPECIAL))
> + {
> + while (altpm && altpm->level > pm->level) {
> + oldpm = altpm;
> + altpm = altpm->old;
> + }
> }
> if (altpm) {
> if (oldpm && !altpm->level) {
Hmm... can that loop I've "if"ed out ever be right? It's meaning we're
unsetting the saved version of a parameter, not the visible one. That
looks pretty fishy at any time.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author