__emit: Display proper argument type names in error messages for arguments of type 'local variable'

This commit is contained in:
Daniel_Cortez 2018-11-24 23:35:40 +07:00
parent 00e3e00327
commit e93817be09

View File

@ -6288,23 +6288,27 @@ static void SC_FASTCALL emit_param_local(emit_outval *p)
} else {
sym=findglb(str,sSTATEVAR);
if (sym==NULL) {
undefined_sym:
error(17,str); /* undefined symbol */
return;
} /* if */
markusage(sym,uREAD | uWRITTEN);
if (sym->ident!=iCONSTEXPR)
goto undefined_sym;
if (sym->ident!=iCONSTEXPR) {
if (sym->ident==iFUNCTN || sym->ident==iREFFUNC)
tok=((sym->usage & uNATIVE)!=0) ? teNATIVE : teFUNCTN;
else
tok=teDATA;
goto invalid_token;
} /* if */
} /* if */
val=sym->addr;
break;
default:
invalid_token:
emit_invalid_token(tSYMBOL,tok);
emit_invalid_token(teLOCAL,tok);
return;
} /* switch */
if ((val % sizeof(cell))==0)
p->value.ucell = (ucell)val;
p->value.ucell=(ucell)val;
else
error(11); /* must be a multiple of cell size */
}