1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-26 17:36:57 +00:00

Fixed comparing an enum type with a non-enum type in DoCompare().

This commit is contained in:
acqn 2020-09-07 04:19:27 +08:00 committed by Oliver Schmidt
parent 6e0fb630d7
commit 1cde952cf5

View File

@ -203,8 +203,8 @@ static void DoCompare (const Type* lhs, const Type* rhs, typecmp_t* Result)
if ((IsTypeEnum (lhs) || IsTypeEnum (rhs))) {
/* Compare the tag types */
Sym1 = GetESUSymEntry (lhs);
Sym2 = GetESUSymEntry (rhs);
Sym1 = IsTypeEnum (lhs) ? GetESUSymEntry (lhs) : 0;
Sym2 = IsTypeEnum (rhs) ? GetESUSymEntry (rhs) : 0;
if (Sym1 != Sym2) {
if (Sym1 == 0 || Sym2 == 0) {