Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: core dump with arithmetic assignment



Adam Spiers wrote:

> I haven't recompiled for quite a few patches now, so this may already
> be fixed.
> 
> % (( 1 = 1 )) && echo hi
> zsh: lvalue required
> zsh: 11025 segmentation fault (core dumped)  /bin/zsh

This at least avoids the SEGV and probably is even the correct fix. At 
least it seems strange to first test for `if (!s)', print the error if 
that is true and later try `setnparam(s, v)'. And returning the
value built after the `zerr()' seems ok, too. And `noeval' seems to be 
used for something else.

Bye
 Sven

--- oldsrc/math.c	Thu Oct 14 16:26:25 1999
+++ Src/math.c	Fri Oct 15 08:26:57 1999
@@ -467,6 +467,7 @@
 	zerr("lvalue required", NULL, 0);
 	v.type = MN_INTEGER;
 	v.u.l = 0;
+	return v;
     }
     if (noeval)
 	return v;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author