From dbba5f3fc9ec1256b7226f458531b81bac25e983 Mon Sep 17 00:00:00 2001 From: acqn Date: Sun, 4 Oct 2020 17:01:20 +0800 Subject: [PATCH] Fixed handling of %v in inline asm parser. --- src/cc65/asmstmt.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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)); } }