Skip to content

Commit

Permalink
Generalize the native index fix to all instructions
Browse files Browse the repository at this point in the history
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
(bb4163e) affected only SYSREQ.C
instructions, thus using natives with other instructions (for example,
with CONST.pri) would still result in an incorrect index.
  • Loading branch information
Zeex committed Jan 2, 2014
1 parent bb4163e commit 0fa621f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions source/compiler/sc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 0fa621f

Please sign in to comment.