From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2570 invoked from network); 25 Sep 2001 12:48:45 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Sep 2001 12:48:45 -0000 Received: (qmail 10810 invoked by alias); 25 Sep 2001 12:48:38 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15869 Received: (qmail 10792 invoked from network); 25 Sep 2001 12:48:36 -0000 From: Sven Wischnowsky Message-ID: <15280.32035.41701.167303@gargle.gargle.HOWL> Date: Tue, 25 Sep 2001 14:48:35 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: zsh-workers@sunsite.dk Subject: Re: segfaults in 4.0.2 In-Reply-To: <15280.29564.199223.966604@gargle.gargle.HOWL> References: <010907170335.ZM18221@candle.brasslantern.com> <20010908015928.A21707@dman.com> <1010908070005.ZM18696@candle.brasslantern.com> <20010908113425.A27879@dman.com> <1010908184745.ZM19990@candle.brasslantern.com> <15280.29564.199223.966604@gargle.gargle.HOWL> X-Mailer: VM 6.92 under 21.1 (patch 3) "Acadia" XEmacs Lucid 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