Merge branches 'master' and 'preproc-paste-fix'

This commit is contained in:
Cyrill Gorcunov 2010-07-13 21:16:05 +04:00
commit fed61a547f
3 changed files with 16 additions and 18 deletions

View File

@ -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
View 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

View File

@ -1 +1 @@
2.09rc2
2.09rc3