1
0
mirror of https://github.com/cc65/cc65.git synced 2025-08-09 13:25:06 +00:00

Using a dedicated SC_FICTITIOUS flag in case of parsing errors.

This commit is contained in:
acqn
2020-08-10 09:32:47 +08:00
committed by Oliver Schmidt
parent bde5be6793
commit 4dfc1a5ded
4 changed files with 4 additions and 3 deletions

View File

@@ -148,7 +148,7 @@ static void Parse (void)
break; break;
} }
if ((Decl.StorageClass & SC_ALIAS) == SC_ALIAS) { if ((Decl.StorageClass & SC_FICTITIOUS) == SC_FICTITIOUS) {
/* Failed parsing */ /* Failed parsing */
goto SkipOneDecl; goto SkipOneDecl;
} }

View File

@@ -1907,7 +1907,7 @@ void ParseDecl (const DeclSpec* Spec, Declaration* D, declmode_t Mode)
if (PrevErrorCount != ErrorCount) { if (PrevErrorCount != ErrorCount) {
/* Don't give storage if the declaration is not parsed correctly */ /* Don't give storage if the declaration is not parsed correctly */
D->StorageClass |= SC_DECL | SC_ALIAS; D->StorageClass |= SC_DECL | SC_FICTITIOUS;
} }
} }
} }

View File

@@ -455,7 +455,7 @@ static void ParseOneDecl (const DeclSpec* Spec)
} }
/* If the symbol is not marked as external, it will be defined now */ /* If the symbol is not marked as external, it will be defined now */
if ((Decl.StorageClass & SC_ALIAS) == 0 && if ((Decl.StorageClass & SC_FICTITIOUS) == 0 &&
(Decl.StorageClass & SC_EXTERN) == 0) { (Decl.StorageClass & SC_EXTERN) == 0) {
Decl.StorageClass |= SC_DEF; Decl.StorageClass |= SC_DEF;
} }

View File

@@ -106,6 +106,7 @@ struct CodeEntry;
#define SC_GOTO_IND 0x800000U /* Indirect goto */ #define SC_GOTO_IND 0x800000U /* Indirect goto */
#define SC_ALIAS 0x01000000U /* Alias of anonymous field */ #define SC_ALIAS 0x01000000U /* Alias of anonymous field */
#define SC_FICTITIOUS 0x02000000U /* Symbol is fictitious */