1
0
mirror of https://github.com/cc65/cc65.git synced 2025-02-26 23:30:03 +00:00

Minor rearrangements to make the code more robust in case of errors.

git-svn-id: svn://svn.cc65.org/cc65/trunk@549 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2000-12-04 20:39:17 +00:00
parent e131b6e432
commit cd6f591d11
2 changed files with 6 additions and 4 deletions

View File

@ -219,7 +219,7 @@ static void Parse (void)
}
/* Function declaration? */
if (IsTypeFunc (Decl.Type)) {
if (Entry && IsTypeFunc (Entry->Type)) {
/* Function */
if (!comma) {

View File

@ -696,6 +696,7 @@ SymEntry* AddGlobalSym (const char* Name, type* Type, unsigned Flags)
TypeCmp (Type+DECODE_SIZE+1, EType+DECODE_SIZE+1) < TC_EQUAL) {
/* Types not identical: Conflicting types */
Error ("Conflicting types for `%s'", Name);
return Entry;
} else {
/* Check if we have a size in the existing definition */
if (ESize == 0) {
@ -708,6 +709,7 @@ SymEntry* AddGlobalSym (const char* Name, type* Type, unsigned Flags)
/* New type must be identical */
if (TypeCmp (EType, Type) < TC_EQUAL) {
Error ("Conflicting types for `%s'", Name);
return Entry;
}
/* In case of a function, use the new type descriptor, since it