1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-15 17:30:06 +00:00

Merge pull request #2245 from acqn/MinorFix

[cc65] Avoided unnecessary BSS name duplication for tentative global variables
This commit is contained in:
Bob Andrews 2023-10-28 15:26:31 +02:00 committed by GitHub
commit 65aad16d83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -285,11 +285,14 @@ static void Parse (void)
*/
const char* bssName = GetSegName (SEG_BSS);
if (Sym->V.BssName && strcmp (Sym->V.BssName, bssName) != 0) {
Error ("Global variable '%s' already was defined in the '%s' segment.",
Sym->Name, Sym->V.BssName);
if (Sym->V.BssName != 0) {
if (strcmp (Sym->V.BssName, bssName) != 0) {
Error ("Global variable '%s' already was defined in the '%s' segment",
Sym->Name, Sym->V.BssName);
}
} else {
Sym->V.BssName = xstrdup (bssName);
}
Sym->V.BssName = xstrdup (bssName);
/* This is to make the automatical zeropage setting of the symbol
** work right.