fixed bug amb259

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40751
This commit is contained in:
David Anderson 2007-05-06 19:13:39 +00:00
parent 16fa9e0fa6
commit b8e2b6cf68
2 changed files with 7 additions and 4 deletions

View File

@ -3985,7 +3985,7 @@ static int newfunc(char *firstname,int firsttag,int fpublic,int fstatic,int stoc
if (matchtoken(';')) { if (matchtoken(';')) {
sym->usage|=uFORWARD; sym->usage|=uFORWARD;
if (!sc_needsemicolon) if (!sc_needsemicolon)
error(218); /* old style prototypes used with optional semicolumns */ error(10); /* old style prototypes used with optional semicolumns */
delete_symbols(&loctab,0,TRUE,TRUE); /* prototype is done; forget everything */ delete_symbols(&loctab,0,TRUE,TRUE); /* prototype is done; forget everything */
return TRUE; return TRUE;
} /* if */ } /* if */

View File

@ -2674,9 +2674,12 @@ static int nesting=0;
if ((sym->usage & uNATIVE)==0) if ((sym->usage & uNATIVE)==0)
totalsize++; /* add "call" opcode */ totalsize++; /* add "call" opcode */
totalsize+=nest_stkusage; totalsize+=nest_stkusage;
assert(curfunc!=NULL); if (curfunc != NULL) {
if (curfunc->x.stacksize<totalsize) if (curfunc->x.stacksize<totalsize)
curfunc->x.stacksize=totalsize; curfunc->x.stacksize=totalsize;
} else {
error(10);
}
nest_stkusage-=nargs+heapalloc+1; /* stack/heap space, +1 for argcount param */ nest_stkusage-=nargs+heapalloc+1; /* stack/heap space, +1 for argcount param */
/* if there is a syntax error in the script, the stack calculation is /* if there is a syntax error in the script, the stack calculation is
* probably incorrect; but we may not allow it to drop below zero * probably incorrect; but we may not allow it to drop below zero