From 92defb7a2b1638f5e8949dfff5eef9c04a167ff1 Mon Sep 17 00:00:00 2001 From: laubzega Date: Wed, 3 Oct 2018 21:59:19 -0700 Subject: [PATCH] Fix crash due to mistaken symbol identity. --- src/cc65/symtab.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cc65/symtab.c b/src/cc65/symtab.c index 87fad111b..c875360e3 100644 --- a/src/cc65/symtab.c +++ b/src/cc65/symtab.c @@ -839,6 +839,12 @@ SymEntry* AddGlobalSym (const char* Name, const Type* T, unsigned Flags) Type* EType; + /* Even if the symbol already exists, let's make sure it + ** is not an ENUM. See bug #728. */ + if (Entry->Flags & SC_ENUM) { + Fatal ("Conflicting types for `%s'", Name); + } + /* We have a symbol with this name already */ if (Entry->Flags & SC_TYPE) { Error ("Multiple definition for `%s'", Name); -- 2.39.5