X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=symbol.c;h=d4761214006bf4a98e631cc89fb8321344e4d447;hp=b13ef3c52fb1de59ea871a2f1531029cc83f6b79;hb=090bda1c00a18b3f616e734090ba456a461879a1;hpb=daf2f61a3664329ae7f9609e1e14da2b8780fd10 diff --git a/symbol.c b/symbol.c index b13ef3c..d476121 100644 --- a/symbol.c +++ b/symbol.c @@ -11,6 +11,7 @@ #include "procln.h" #include "error.h" + // Macros #define NBUCKETS 256 // Number of hash buckets (power of 2) @@ -90,7 +91,12 @@ SYM * NewSymbol(char * name, int type, int envno) symbol->stype = (BYTE)type; symbol->senv = (WORD)envno; symbol->sattr = 0; - symbol->sattre = (rgpu || rdsp ? RISCSYM : 0); +//we don't do this, it could be a forward reference! +// symbol->sattr = DEFINED; // We just defined it... + // This is a bad assumption. Not every symbol 1st seen in a RISC section is + // a RISC symbol! +// symbol->sattre = (rgpu || rdsp ? RISCSYM : 0); + symbol->sattre = 0; symbol->svalue = 0; symbol->sorder = NULL; symbol->uid = currentUID++; @@ -150,20 +156,22 @@ SYM * lookup(char * name, int type, int envno) if (symbol->stype == type // Type, envno and name must match && symbol->senv == envno && *name == *symbol->sname // Fast check for first character - && !strcmp(name, symbol->sname)) + && !strcmp(name, symbol->sname)) // More expensive check break; symbol = symbol->snext; } - return symbol; // Return NULL or matching symbol + // Return NULL or matching symbol + return symbol; } // // Put symbol on "order-of-declaration" list of symbols // -void sym_decl(SYM * symbol) +//void sym_decl(SYM * symbol) +void AddToSymbolOrderList(SYM * symbol) { if (symbol->sattr & SDECLLIST) return; // Already on list