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

Re: Autoload syntax error causes heap bug warning



On Mon, 06 Jun 2011 06:59:28 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> torch% autoload cause_bug
> torch% compdef cause_bug foo
> torch% foo <TAB>
> cause_bug:3: parse error near `\n'
> 7: Src/mem.c:217: BUG: old_heaps() with pushed heaps
> 
> torch% cat /tmp/test/cause_bug
> : deliberate sytax error:
> while

So this is what's been causing all those years of error messages from
failed autoloads...

I'll look for more missing popheap()s.

Index: Src/exec.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/exec.c,v
retrieving revision 1.197
diff -p -u -r1.197 exec.c
--- Src/exec.c	19 Jun 2011 20:12:00 -0000	1.197
+++ Src/exec.c	23 Jun 2011 19:14:53 -0000
@@ -4343,6 +4343,7 @@ loadautofn(Shfunc shf, int fksh, int aut
     }
     if (!prog) {
 	zsfree(fname);
+	popheap();
 	return NULL;
     }
     if (ksh == 2 || (ksh == 1 && isset(KSHAUTOLOAD))) {

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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