mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-12-03 08:41:02 +08:00
Merge branches 'master' and 'preproc-paste-fix'
This commit is contained in:
commit
fed61a547f
20
preproc.c
20
preproc.c
@ -3509,7 +3509,6 @@ static bool paste_tokens(Token **head, bool handle_paste_tokens)
|
||||
}
|
||||
break;
|
||||
case TOK_ID:
|
||||
case TOK_PREPROC_ID:
|
||||
case TOK_NUMBER:
|
||||
case TOK_FLOAT:
|
||||
{
|
||||
@ -3586,7 +3585,9 @@ static bool paste_tokens(Token **head, bool handle_paste_tokens)
|
||||
}
|
||||
/* else fall through */
|
||||
default:
|
||||
tail = paste_head = &t->next;
|
||||
tail = &t->next;
|
||||
if (!tok_type_(t->next, TOK_WHITESPACE))
|
||||
paste_head = tail;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -3820,21 +3821,6 @@ static Token *expand_mmac_params(Token * tline)
|
||||
}
|
||||
delete_Token(t);
|
||||
changed = true;
|
||||
} else if (tline->type == TOK_PREPROC_ID &&
|
||||
tline->text[0] == '%' && tline->text[1] == '$') {
|
||||
/* expand local macro */
|
||||
t = tline;
|
||||
tline = tline->next;
|
||||
tt = tokenize(t->text);
|
||||
tt = expand_smacro(tt);
|
||||
*tail = tt;
|
||||
while (tt) {
|
||||
tt->a.mac = NULL;
|
||||
tail = &tt->next;
|
||||
tt = tt->next;
|
||||
}
|
||||
delete_Token(t);
|
||||
changed = true;
|
||||
} else {
|
||||
t = *tail = tline;
|
||||
tline = tline->next;
|
||||
|
12
test/paste.asm
Normal file
12
test/paste.asm
Normal file
@ -0,0 +1,12 @@
|
||||
%macro bug 1-*
|
||||
%push foo
|
||||
%define %$v %1
|
||||
%define vv %$v_ %+ %1
|
||||
%%top_{%$v}%1:
|
||||
mov eax, eax
|
||||
mov eax, %%top_{%$v}%1
|
||||
mov eax, vv
|
||||
%pop
|
||||
%endmacro
|
||||
|
||||
bug a
|
Loading…
Reference in New Issue
Block a user