Generalize the native index fix to all instructions

It is possible to use natives in any instructions and their name should
evaluate to a native table index. But the patch in the previous commit
(bb4163ea456fab54385f7310b4e20949cda0aaa6) affected only SYSREQ.C
instructions, thus using natives with other instructions (for example,
with CONST.pri) would still result in an incorrect index.
This commit is contained in:
Zeex 2014-01-03 04:35:15 +07:00
parent bb4163ea45
commit 0fa621f5e8

View File

@ -1224,8 +1224,7 @@ static int command(void)
assert((sym->ident & iFUNCTN)!=0 || (sym->ident & iREFFUNC)!=0);
stgwrite(sym->name);
} else {
if (strcmp(name, "sysreq.c")==0) {
assert((sym->ident & iFUNCTN)!=0 && (sym->usage & uNATIVE)!=0);
if ((sym->ident & iFUNCTN)!=0 && (sym->usage & uNATIVE)!=0) {
if (sc_status==statWRITE && (sym->usage & uREAD)==0 && sym->addr>=0) {
/* reserve a SYSREQ id if called for the first time */
sym->addr=ntv_funcid++;