From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11480 invoked from network); 2 Feb 2000 08:45:59 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 2 Feb 2000 08:45:59 -0000 Received: (qmail 13201 invoked by alias); 2 Feb 2000 08:45:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9524 Received: (qmail 13193 invoked from network); 2 Feb 2000 08:45:54 -0000 Date: Wed, 2 Feb 2000 09:45:53 +0100 (MET) Message-Id: <200002020845.JAA09989@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Peter Stephenson's message of Tue, 01 Feb 2000 20:53:26 +0000 Subject: Re: Wordcode bug with $functions Peter Stephenson wrote: > I'm getting a segmentation fault with `print $functions', even patched up > to date (supposedly). I presume this is a new wordcode feature. This is > reproducible with my addpath function by doing `which addpath'. I narrowed > it down: actually, this form doesn't give a crash, but it does show more > clearly what's going wrong. When dumping function definitions it didn't set state->pc to the calculated end. > By the way, I found this by doing `set' on its own. This dumps out the > whole of every function when zsh/parameter is loaded. Yuck. And usernames and commands and ... But that's how it's supposed to work, isn't it? And it was rather ugly before already (e.g. $_comps and probably other parameters like the caches). Bye Sven diff -ru ../z.old/Src/text.c Src/text.c --- ../z.old/Src/text.c Wed Feb 2 09:34:48 2000 +++ Src/text.c Wed Feb 2 09:40:40 2000 @@ -182,6 +182,7 @@ } _redir; struct { char *strs; + Wordcode end; } _funcdef; struct { Wordcode end; @@ -372,11 +373,13 @@ taddnl(); n = tpush(code, 1); n->u._funcdef.strs = state->strs; + n->u._funcdef.end = end; state->strs = (char *) (p + (*state->pc)); state->pc += 2; } } else { state->strs = s->u._funcdef.strs; + state->pc = s->u._funcdef.end; tindent--; taddnl(); taddstr("}"); -- Sven Wischnowsky wischnow@informatik.hu-berlin.de