From 4f099e7eb1b196b8360e9d914bc6895fdc0c7dca Mon Sep 17 00:00:00 2001 From: Daniel_Cortez Date: Wed, 31 Jan 2018 04:09:05 +0700 Subject: [PATCH] emit: Disallow the use of the '-' sign with function names for arguments of type 'any' --- source/compiler/sc1.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/compiler/sc1.c b/source/compiler/sc1.c index b1ad703..f2a2465 100644 --- a/source/compiler/sc1.c +++ b/source/compiler/sc1.c @@ -5984,6 +5984,8 @@ fetchtok: goto invalid_token; } /* if */ 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) sym->addr=ntv_funcid++; markusage(sym,uREAD); @@ -6012,9 +6014,10 @@ fetchtok: neg=TRUE; goto fetchtok; } else { - char ival[sNAMEMAX+2]="-"; - strcpy(ival+1,str); - error(1,sc_tokens[tSYMBOL-tFIRST],ival); + char ival[sNAMEMAX+2]; + invalid_token_neg: + sprintf(ival,"-%s",str); + error(1,sc_tokens[teNUMERIC-tFIRST],ival); break; } /* if */ default: