diff --git a/src/cc65/asmstmt.c b/src/cc65/asmstmt.c index bf5a0815b..d182140fd 100644 --- a/src/cc65/asmstmt.c +++ b/src/cc65/asmstmt.c @@ -213,7 +213,9 @@ static void ParseLongArg (StrBuf* T, unsigned Arg attribute ((unused))) static void ParseGVarArg (StrBuf* T, unsigned Arg) -/* Parse the %v format specifier */ +/* Parse the %v format specifier. +** ### FIXME: Asm names should be generated in the same place. +*/ { /* Parse the symbol name parameter and check the type */ SymEntry* Sym = AsmGetSym (Arg, SC_STATIC); @@ -225,7 +227,6 @@ static void ParseGVarArg (StrBuf* T, unsigned Arg) /* Check for external linkage */ if (Sym->Flags & (SC_EXTERN | SC_STORAGE | SC_FUNC)) { /* External linkage or a function */ - /* ### FIXME: Asm name should be generated by codegen */ SB_AppendChar (T, '_'); SB_AppendStr (T, Sym->Name); } else if (Sym->Flags & SC_REGISTER) { @@ -234,9 +235,7 @@ static void ParseGVarArg (StrBuf* T, unsigned Arg) SB_AppendStr (T, Buf); } else { /* Static variable */ - char Buf [16]; - xsprintf (Buf, sizeof (Buf), "L%04X", Sym->V.L.Label); - SB_AppendStr (T, Buf); + SB_AppendStr (T, LocalDataLabelName (Sym->V.L.Label)); } }