From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: SegFault in stringsubst
Date: Fri, 18 Apr 2014 10:02:00 -0700 [thread overview]
Message-ID: <140418100200.ZM23843@torch.brasslantern.com> (raw)
In-Reply-To: <20140418160344.GA10455@ewok>
On Apr 19, 2:03am, Andrew Waldron wrote:
}
} Seems like a similar check should be made for anonymous function
} arguments so that lastval will be set?
This is beginning to have knock-on effects that concern me. E.g.:
* I don't know whether the lastval ternary test is the right thing, or
if an unconditional return of 1 is appropriate (should lastval be
checked in the code I already committed?);
* if we're testing errflag here, we should also do it when evaluating
"for" and "select" loops (loop.c), which is pushing a new failure
mode pretty far afield from the original bug;
* which means I'd be a lot happier if we were detecting this as a
syntax error instead of a run-time error, but that may be pretty
difficult to do.
} diff --git a/Src/exec.c b/Src/exec.c
} index f16cfd3..36b7efa 100644
} --- a/Src/exec.c
} +++ b/Src/exec.c
} @@ -4291,8 +4291,11 @@ execfuncdef(Estate state, UNUSED(int do_exec))
} end += *state->pc++;
} args = ecgetlist(state, *state->pc++, EC_DUPTOK, &htok);
}
} - if (htok && args)
} + if (htok && args) {
} execsubst(args);
} + if (errflag)
} + return lastval ? lastval : 1;
} + }
}
} if (!args)
} args = newlinklist();
next prev parent reply other threads:[~2014-04-18 17:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-16 4:46 Andrew Waldron
2014-04-16 5:15 ` Bart Schaefer
2014-04-16 6:19 ` Andrew Waldron
2014-04-16 16:13 ` Bart Schaefer
2014-04-17 8:58 ` Peter Stephenson
2014-04-17 18:42 ` Bart Schaefer
2014-04-18 16:03 ` Andrew Waldron
2014-04-18 17:02 ` Bart Schaefer [this message]
2014-04-19 17:54 ` Bart Schaefer
2014-04-20 18:00 ` Sanity of lastval ($?) in for/select loops Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=140418100200.ZM23843@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).