preproc.c: Support multiple matches in paste_tokens
commit575d4289c9b1fb47774cb79764a24899a69a8d52
authorCyrill Gorcunov <gorcunov@gmail.com>
Tue, 5 Oct 2010 20:25:55 +0000 (6 00:25 +0400)
committerCyrill Gorcunov <gorcunov@gmail.com>
Wed, 6 Oct 2010 21:16:26 +0000 (7 01:16 +0400)
treea8c1e744b588559b8ffbb5f51fc4dcd365c62e91
parent9d0701ecbffdd6ec197bd382e644c5d5072188cf
preproc.c: Support multiple matches in paste_tokens

In mmacro params head TOK_NUM should be concat'ed with
tail TOK_NUM only, otherwise the weird construction like

    %define id1      1
    %define idid1    2
    %define TOK_NUM  1
    %define TOK_ID  id

    %macro m 2
        mov eax, 1%1id%2 ; this expands to 1idid1
                         ; where idid1 expands to 2
                         ; and then to 12
    %endmacro

    m TOK_ID, TOK_NUM

issue error.

N.B. I've checked nasm-0.98.39 and it compiles this macro
perfectly well, for the record.

Reported-by: nasm64developer@users.sf.net
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
preproc.c