Fixed handling of %v in inline asm parser.
This commit is contained in:
@@ -213,7 +213,9 @@ static void ParseLongArg (StrBuf* T, unsigned Arg attribute ((unused)))
|
|||||||
|
|
||||||
|
|
||||||
static void ParseGVarArg (StrBuf* T, unsigned Arg)
|
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 */
|
/* Parse the symbol name parameter and check the type */
|
||||||
SymEntry* Sym = AsmGetSym (Arg, SC_STATIC);
|
SymEntry* Sym = AsmGetSym (Arg, SC_STATIC);
|
||||||
@@ -225,7 +227,6 @@ static void ParseGVarArg (StrBuf* T, unsigned Arg)
|
|||||||
/* Check for external linkage */
|
/* Check for external linkage */
|
||||||
if (Sym->Flags & (SC_EXTERN | SC_STORAGE | SC_FUNC)) {
|
if (Sym->Flags & (SC_EXTERN | SC_STORAGE | SC_FUNC)) {
|
||||||
/* External linkage or a function */
|
/* External linkage or a function */
|
||||||
/* ### FIXME: Asm name should be generated by codegen */
|
|
||||||
SB_AppendChar (T, '_');
|
SB_AppendChar (T, '_');
|
||||||
SB_AppendStr (T, Sym->Name);
|
SB_AppendStr (T, Sym->Name);
|
||||||
} else if (Sym->Flags & SC_REGISTER) {
|
} else if (Sym->Flags & SC_REGISTER) {
|
||||||
@@ -234,9 +235,7 @@ static void ParseGVarArg (StrBuf* T, unsigned Arg)
|
|||||||
SB_AppendStr (T, Buf);
|
SB_AppendStr (T, Buf);
|
||||||
} else {
|
} else {
|
||||||
/* Static variable */
|
/* Static variable */
|
||||||
char Buf [16];
|
SB_AppendStr (T, LocalDataLabelName (Sym->V.L.Label));
|
||||||
xsprintf (Buf, sizeof (Buf), "L%04X", Sym->V.L.Label);
|
|
||||||
SB_AppendStr (T, Buf);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user