Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] jp: fix segfaults during parameter expansion
- X-seq: zsh-workers 42307
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] jp: fix segfaults during parameter expansion
- Date: Sat, 20 Jan 2018 16:03:04 -0800
- Cc: Daniel Tameling <tamelingdaniel@xxxxxxxxx>, Joey Pabalinas <joeypabalinas@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject:cc :mime-version; bh=JzAC332jlw/Seoq5OS58vZqjxw/lgQSkpLB1FEkx3tw=; b=tFrFxm/gOA1wuJO1u5MqsmNMCCg9sdZhr8Pajsijb6iWlaVVyciTsyXUuVrPzfdgng dwKLFcYGNvLI6ut9/VGSuwSBvsou1ZYIhjq9Gz0XbxR5I57KCCCU2W/l0O1NWvb0tink /DqUmsaE36RVtq0q/8CUtI3VfIaraAFr4MYbfwgVZR0BNbkwnGiIYaW7Tao/K83eqpKV XDcQ4vROQZdlLkWj0Ji00CLO2MY70U7Em2Xcux1VUQID278p6Wl7kEzvsQJ9NWeKabqv 0U0FHUzKr4cQyy5gicI2C/MfP11wzJr+LesgAOg6LDo8VCHcRFh8TdnbaepOcubFY9U4 pZHw==
- In-reply-to: <m2fu705wuy.fsf@gmail.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: <20180114060557.hmrvpg6t4rdebgv6@gmail.com> <CAH+w=7bMF_Kzvme+5EVazsa2KKEHO2uh2-u_T0MSAx2H=zcXQg@mail.gmail.com> <m2fu705wuy.fsf@gmail.com>
On Jan 20, 5:16pm, Daniel Tameling wrote:
}
} while working through my email backlog, I noticed that my zsh didn't
} segfault. I used git bisect, and it looks like commit
} 4b8db48c6bd3c0230a5d81f49e478857adf9cda8 introduced it.
This is a bit of a red herring -- the fault is actually in the handling
of the (P) flag. What this commit changed was the handling of the (A)
flag, to make it independent of the ${name=value} syntax.
The potential bug in handling of (P) has always been there, but we never
attempted to convert the scalar into an array in that context before.
My patch in workers/42268 addresses the thing that crashes. However,
I think the following may be better:
torch% : ${${(PAA)p[foo]}::=x}
zsh: parameter name reference used with array
diff --git a/Src/subst.c b/Src/subst.c
index d027e3d..042ef28 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2423,7 +2423,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
* substitution.
*/
if (isarr) {
- if (aval[0] && aval[1]) {
+ if (!aval[0] || (aval[0] && aval[1])) {
zerr("parameter name reference used with array");
return NULL;
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author