allow $ at nonstarting positions in asm symbols under -fdollars-in-identifiers

e.g., asm("foo$bar: ret;");
This commit is contained in:
Petr Skocik 2025-10-23 16:48:26 +02:00
parent 543d84c668
commit 5675177b7f
2 changed files with 3 additions and 3 deletions

View File

@ -1100,7 +1100,7 @@ static void tcc_assemble_inline(TCCState *s1, const char *str, int len, int glob
{
const int *saved_macro_ptr = macro_ptr;
int dotid = set_idnum('.', IS_ID);
#ifndef TCC_TARGET_RISCV64
#if !defined(TCC_TARGET_RISCV64) && !defined(TCC_TARGET_X86_64)
int dolid = set_idnum('$', 0);
#endif
@ -1110,7 +1110,7 @@ static void tcc_assemble_inline(TCCState *s1, const char *str, int len, int glob
tcc_assemble_internal(s1, 0, global);
tcc_close();
#ifndef TCC_TARGET_RISCV64
#if !defined(TCC_TARGET_RISCV64) && !defined(TCC_TARGET_X86_64)
set_idnum('$', dolid);
#endif
set_idnum('.', dotid);

View File

@ -3712,7 +3712,7 @@ ST_FUNC void preprocess_start(TCCState *s1, int filetype)
s1->pack_stack[0] = 0;
s1->pack_stack_ptr = s1->pack_stack;
set_idnum('$', !is_asm && s1->dollars_in_identifiers ? IS_ID : 0);
set_idnum('$', s1->dollars_in_identifiers ? IS_ID : 0);
set_idnum('.', is_asm ? IS_ID : 0);
if (!(filetype & AFF_TYPE_ASM)) {