1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00

Avoided unnecessary BSS name duplication for tentative global variables.

This commit is contained in:
acqn 2022-10-11 14:23:21 +08:00
parent 94ef5856d0
commit d1e84a6dae

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.