emit: Disallow the use of the '-' sign with function names for arguments of type 'any'

This commit is contained in:
Daniel_Cortez 2018-01-31 04:09:05 +07:00
parent f34aa7d9b7
commit 4f099e7eb1

View File

@ -5984,6 +5984,8 @@ fetchtok:
goto invalid_token; goto invalid_token;
} /* if */ } /* if */
if (sym->ident==iFUNCTN || sym->ident==iREFFUNC) { if (sym->ident==iFUNCTN || sym->ident==iREFFUNC) {
if (neg!=FALSE)
goto invalid_token_neg;
if ((sym->usage & uNATIVE)!=0 && (sym->usage & uREAD)==0 && sym->addr>=0) if ((sym->usage & uNATIVE)!=0 && (sym->usage & uREAD)==0 && sym->addr>=0)
sym->addr=ntv_funcid++; sym->addr=ntv_funcid++;
markusage(sym,uREAD); markusage(sym,uREAD);
@ -6012,9 +6014,10 @@ fetchtok:
neg=TRUE; neg=TRUE;
goto fetchtok; goto fetchtok;
} else { } else {
char ival[sNAMEMAX+2]="-"; char ival[sNAMEMAX+2];
strcpy(ival+1,str); invalid_token_neg:
error(1,sc_tokens[tSYMBOL-tFIRST],ival); sprintf(ival,"-%s",str);
error(1,sc_tokens[teNUMERIC-tFIRST],ival);
break; break;
} /* if */ } /* if */
default: default: