* Re: Wordcode bug with $functions
@ 2000-02-02 8:45 Sven Wischnowsky
0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 2000-02-02 8:45 UTC (permalink / raw)
To: zsh-workers
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Wordcode bug with $functions
@ 2000-02-01 20:53 Peter Stephenson
0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2000-02-01 20:53 UTC (permalink / raw)
To: Zsh hackers list
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.
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.
% fn() {
a() { true; }
b() { true; }
}
% which fn
unknown word code in gettext2()
fn () {
a () {
true
}
}
--
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-02-02 8:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-02 8:45 Wordcode bug with $functions Sven Wischnowsky
-- strict thread matches above, loose matches on Subject: below --
2000-02-01 20:53 Peter Stephenson
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).