1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-11 11:30:13 +00:00

Fixed a bug - enum tags were inserted into the wrong table

git-svn-id: svn://svn.cc65.org/cc65/trunk@2484 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2003-10-09 18:56:38 +00:00
parent 923ae328a5
commit 89d4ba5553

View File

@ -584,8 +584,11 @@ SymEntry* AddStructSym (const char* Name, unsigned Size, SymTable* Tab)
SymEntry* AddConstSym (const char* Name, const type* Type, unsigned Flags, long Val)
/* Add an constant symbol to the symbol table and return it */
{
/* Enums must be inserted in the global symbol table */
SymTable* Tab = ((Flags & SC_ENUM) == SC_ENUM)? SymTab0 : SymTab;
/* Do we have an entry with this name already? */
SymEntry* Entry = FindSymInTable (SymTab, Name, HashStr (Name));
SymEntry* Entry = FindSymInTable (Tab, Name, HashStr (Name));
if (Entry) {
if ((Entry->Flags & SC_CONST) != SC_CONST) {
Error ("Symbol `%s' is already different kind", Name);
@ -605,7 +608,7 @@ SymEntry* AddConstSym (const char* Name, const type* Type, unsigned Flags, long
Entry->V.ConstVal = Val;
/* Add the entry to the symbol table */
AddSymEntry (SymTab, Entry);
AddSymEntry (Tab, Entry);
/* Return the entry */
return Entry;
@ -727,7 +730,7 @@ SymEntry* AddGlobalSym (const char* Name, const type* Type, unsigned Flags)
return Entry;
} else {
/* Check if we have a size in the existing definition */
if (ESize == UNSPECIFIED) {
if (ESize == UNSPECIFIED) {
/* Existing, size not given, use size from new def */
Encode (EType + 1, Size);
}