1
0
mirror of https://github.com/cc65/cc65.git synced 2025-08-05 17:25:17 +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

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.