__emit: Don't accept numeric constants for arguments of type 'data offset'

This commit is contained in:
Daniel_Cortez 2018-11-24 23:19:55 +07:00
parent 4c8d56c511
commit 00e3e00327

View File

@ -6220,8 +6220,6 @@ static void SC_FASTCALL emit_param_data(emit_outval *p)
p->type=eotNUMBER; p->type=eotNUMBER;
tok=lex(&val,&str); tok=lex(&val,&str);
switch (tok) { switch (tok) {
case tNUMBER:
break;
case tSYMBOL: case tSYMBOL:
sym=findloc(str); sym=findloc(str);
if (sym!=NULL) { if (sym!=NULL) {
@ -6230,8 +6228,8 @@ static void SC_FASTCALL emit_param_data(emit_outval *p)
tok=tLABEL; tok=tLABEL;
goto invalid_token; goto invalid_token;
} /* if */ } /* if */
if (sym->vclass!=sSTATIC && sym->ident!=iCONSTEXPR) { if (sym->vclass!=sSTATIC) {
tok=teLOCAL; tok=(sym->ident==iCONSTEXPR) ? teNUMERIC : teLOCAL;
goto invalid_token; goto invalid_token;
} /* if */ } /* if */
} else { } else {
@ -6245,6 +6243,10 @@ static void SC_FASTCALL emit_param_data(emit_outval *p)
tok=((sym->usage & uNATIVE)!=0) ? teNATIVE : teFUNCTN; tok=((sym->usage & uNATIVE)!=0) ? teNATIVE : teFUNCTN;
goto invalid_token; goto invalid_token;
} /* if */ } /* if */
if (sym->ident==iCONSTEXPR) {
tok=teNUMERIC;
goto invalid_token;
} /* if */
} /* if */ } /* if */
val=sym->addr; val=sym->addr;
break; break;