From 0fa621f5e81e68111bdbe9e72b6b6e1294e57757 Mon Sep 17 00:00:00 2001 From: Zeex Date: Fri, 3 Jan 2014 04:35:15 +0700 Subject: [PATCH] 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. --- source/compiler/sc2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/compiler/sc2.c b/source/compiler/sc2.c index 5887a86..b79d8fa 100644 --- a/source/compiler/sc2.c +++ b/source/compiler/sc2.c @@ -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++;