diff --git a/sourcepawn/compiler/sc1.c b/sourcepawn/compiler/sc1.c index 2bd8e569..f5b7892c 100644 --- a/sourcepawn/compiler/sc1.c +++ b/sourcepawn/compiler/sc1.c @@ -3985,7 +3985,7 @@ static int newfunc(char *firstname,int firsttag,int fpublic,int fstatic,int stoc if (matchtoken(';')) { sym->usage|=uFORWARD; 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 */ return TRUE; } /* if */ diff --git a/sourcepawn/compiler/sc3.c b/sourcepawn/compiler/sc3.c index ce8182d3..d4e780c5 100644 --- a/sourcepawn/compiler/sc3.c +++ b/sourcepawn/compiler/sc3.c @@ -2674,9 +2674,12 @@ static int nesting=0; if ((sym->usage & uNATIVE)==0) totalsize++; /* add "call" opcode */ totalsize+=nest_stkusage; - assert(curfunc!=NULL); - if (curfunc->x.stacksizex.stacksize=totalsize; + if (curfunc != NULL) { + if (curfunc->x.stacksizex.stacksize=totalsize; + } else { + error(10); + } 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 * probably incorrect; but we may not allow it to drop below zero