zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Wordcode bug with $functions
Date: Wed, 2 Feb 2000 09:45:53 +0100 (MET)	[thread overview]
Message-ID: <200002020845.JAA09989@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Peter Stephenson's message of Tue, 01 Feb 2000 20:53:26 +0000


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


             reply	other threads:[~2000-02-02  8:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-02  8:45 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-02-01 20:53 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=200002020845.JAA09989@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.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).