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:
@@ -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)
|
SymEntry* AddConstSym (const char* Name, const type* Type, unsigned Flags, long Val)
|
||||||
/* Add an constant symbol to the symbol table and return it */
|
/* 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? */
|
/* 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) {
|
||||||
if ((Entry->Flags & SC_CONST) != SC_CONST) {
|
if ((Entry->Flags & SC_CONST) != SC_CONST) {
|
||||||
Error ("Symbol `%s' is already different kind", Name);
|
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;
|
Entry->V.ConstVal = Val;
|
||||||
|
|
||||||
/* Add the entry to the symbol table */
|
/* Add the entry to the symbol table */
|
||||||
AddSymEntry (SymTab, Entry);
|
AddSymEntry (Tab, Entry);
|
||||||
|
|
||||||
/* Return the entry */
|
/* Return the entry */
|
||||||
return Entry;
|
return Entry;
|
||||||
|
|||||||
Reference in New Issue
Block a user