Fixed a bug where stocks using native names crashed

This commit is contained in:
David Anderson
2005-09-13 07:32:07 +00:00
parent 2ad557024e
commit db33e50f92
2 changed files with 12 additions and 5 deletions

View File

@ -2206,7 +2206,8 @@ static int nesting=0;
if ((sym->usage & uNATIVE)==0)
totalsize++; /* add "call" opcode */
totalsize+=nest_stkusage;
assert(curfunc!=NULL);
if (!curfunc) /* if we got here, the function is invalid! */
return;
if (curfunc->x.stacksize<totalsize)
curfunc->x.stacksize=totalsize;
nest_stkusage-=nargs+heapalloc+1; /* stack/heap space, +1 for argcount param */