mirror of
https://github.com/cc65/cc65.git
synced 2025-02-27 14:29:52 +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:
parent
e131b6e432
commit
cd6f591d11
@ -219,7 +219,7 @@ static void Parse (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Function declaration? */
|
/* Function declaration? */
|
||||||
if (IsTypeFunc (Decl.Type)) {
|
if (Entry && IsTypeFunc (Entry->Type)) {
|
||||||
|
|
||||||
/* Function */
|
/* Function */
|
||||||
if (!comma) {
|
if (!comma) {
|
||||||
|
@ -696,6 +696,7 @@ SymEntry* AddGlobalSym (const char* Name, type* Type, unsigned Flags)
|
|||||||
TypeCmp (Type+DECODE_SIZE+1, EType+DECODE_SIZE+1) < TC_EQUAL) {
|
TypeCmp (Type+DECODE_SIZE+1, EType+DECODE_SIZE+1) < TC_EQUAL) {
|
||||||
/* Types not identical: Conflicting types */
|
/* Types not identical: Conflicting types */
|
||||||
Error ("Conflicting types for `%s'", Name);
|
Error ("Conflicting types for `%s'", Name);
|
||||||
|
return Entry;
|
||||||
} else {
|
} else {
|
||||||
/* Check if we have a size in the existing definition */
|
/* Check if we have a size in the existing definition */
|
||||||
if (ESize == 0) {
|
if (ESize == 0) {
|
||||||
@ -708,6 +709,7 @@ SymEntry* AddGlobalSym (const char* Name, type* Type, unsigned Flags)
|
|||||||
/* New type must be identical */
|
/* New type must be identical */
|
||||||
if (TypeCmp (EType, Type) < TC_EQUAL) {
|
if (TypeCmp (EType, Type) < TC_EQUAL) {
|
||||||
Error ("Conflicting types for `%s'", Name);
|
Error ("Conflicting types for `%s'", Name);
|
||||||
|
return Entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* In case of a function, use the new type descriptor, since it
|
/* In case of a function, use the new type descriptor, since it
|
||||||
|
Loading…
x
Reference in New Issue
Block a user