From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.dk
Subject: Re: segfaults in 4.0.2
Date: Tue, 25 Sep 2001 14:48:35 +0200 [thread overview]
Message-ID: <15280.32035.41701.167303@gargle.gargle.HOWL> (raw)
In-Reply-To: <15280.29564.199223.966604@gargle.gargle.HOWL>
I wrote:
> ...
>
> I couldn't make it crash, but I can see the problem: it's that empty
> sublist, which the code in text.c wasn't able to handle (it made it
> effectively look one code too far ahead). The code in exec.c has an
> extra test for that, so I've just (more or less) copied it from there.
Ouch, no, that was a bit too simple because of possible simplified
sublists.
Bye
Sven
Index: Src/text.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/text.c,v
retrieving revision 1.8
diff -u -r1.8 text.c
--- Src/text.c 2001/09/25 12:10:05 1.8
+++ Src/text.c 2001/09/25 12:44:13
@@ -274,8 +274,9 @@
break;
case WC_SUBLIST:
if (!s) {
- if (wc_code(*state->pc) != WC_PIPE)
- stack = 1;
+ if (!(WC_SUBLIST_FLAGS(code) & WC_SUBLIST_SIMPLE) &&
+ wc_code(*state->pc) != WC_PIPE)
+ stack = -1;
if (WC_SUBLIST_FLAGS(code) & WC_SUBLIST_NOT)
taddstr(stack ? "!" : "! ");
if (WC_SUBLIST_FLAGS(code) & WC_SUBLIST_COPROC)
@@ -293,7 +294,7 @@
taddstr("coproc ");
}
}
- if (!stack && (WC_SUBLIST_FLAGS(s->code) & WC_SUBLIST_SIMPLE))
+ if (stack < 1 && (WC_SUBLIST_FLAGS(s->code) & WC_SUBLIST_SIMPLE))
state->pc++;
break;
case WC_PIPE:
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next prev parent reply other threads:[~2001-09-25 12:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-07 23:43 periodic " Allan Poindexter
2001-09-08 0:03 ` Bart Schaefer
2001-09-08 0:22 ` Allan Poindexter
2001-09-08 5:59 ` segfaults " Clint Adams
2001-09-08 7:00 ` Bart Schaefer
2001-09-08 15:34 ` Clint Adams
2001-09-08 18:47 ` Bart Schaefer
2001-09-25 12:07 ` Sven Wischnowsky
2001-09-25 12:48 ` Sven Wischnowsky [this message]
2001-09-10 10:47 ` periodic " Peter Stephenson
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=15280.32035.41701.167303@gargle.gargle.HOWL \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.dk \
/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).