Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: segfault
- X-seq: zsh-workers 41225
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Re: segfault
- Date: Sun, 4 Jun 2017 21:00:22 -0700
- 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 :mime-version; bh=09SfEwhJtlxZJethCdzunqkbwJwjYDLwl0md3lj3lh0=; b=cDCYKa2mqugi+IDkCqbFmyCEGy+9Z39MFrn0oYsBbgCs3BsPGKWsJFhsX1GHiiTbZd AULqllIgAdmXvYEx44Bpo5ShIoHIUhoLLmHLi0bGNOKREiswvJL0kEPdX9BCbD8OEaTM Yar82+DvhXC41t61EBWA3IKkpCAJ+L8gJeugnKdNDuc+6ItYQ65n2REpbr8EwvmtDIC+ L0exEE2qSOanZFByH0YQgb/h1YykBt0BN4kytGhzG57R4uO/0wxL20zIVn/aZUhXcGQV jwGT1p1takE5M9shr637iSB8/Ntq0Vn9LEfAn9czysCmBnIW6SDosIumstDe/kNXIg8p cfiQ==
- In-reply-to: <CAH+w=7bwyMPG+UHfUijoeNWXLgiWO3qbO4xxc-cNVfJrdVR9gg@mail.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>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CANwdF+5id5qtSwQouXjnWN65krCLDOo6Kn2xcFxpNCsbTSahzw@mail.gmail.com> <CAH+w=7bwyMPG+UHfUijoeNWXLgiWO3qbO4xxc-cNVfJrdVR9gg@mail.gmail.com>
On Jun 3, 11:38pm, Bart Schaefer wrote:
}
} All you need is ${(AA)1=} which tries to interpret the
} positional parameter $1 as a hash table.
Any obvious problems with the following? Other than that t = "1" so it
ends up looking like a line number in the error message -- but I'm not
sure what to do with that without changing the error message format for
other parameters.
diff --git a/Src/params.c b/Src/params.c
index d92dd22..6fbee88 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -3242,12 +3242,17 @@ sethparam(char *s, char **val)
if (!(v = fetchvalue(&vbuf, &s, 1, SCANPM_ASSIGNING))) {
createparam(t, PM_HASHED);
checkcreate = 1;
- } else if (!(PM_TYPE(v->pm->node.flags) & PM_HASHED) &&
- !(v->pm->node.flags & PM_SPECIAL)) {
- unsetparam(t);
- /* no WARNCREATEGLOBAL check here as parameter already existed */
- createparam(t, PM_HASHED);
- v = NULL;
+ } else if (!(PM_TYPE(v->pm->node.flags) & PM_HASHED)) {
+ if (!(v->pm->node.flags & PM_SPECIAL)) {
+ unsetparam(t);
+ /* no WARNCREATEGLOBAL check here as parameter already existed */
+ createparam(t, PM_HASHED);
+ v = NULL;
+ } else {
+ zerr("%s: can't change type of a special parameter", t);
+ unqueue_signals();
+ return NULL;
+ }
}
if (!v)
if (!(v = fetchvalue(&vbuf, &t, 1, SCANPM_ASSIGNING))) {
Messages sorted by:
Reverse Date,
Date,
Thread,
Author