In case if there a production
{tok},{%+},{whitespace}*
the preprocessor does not delete
ending paste+spaces tokens. Fix it.
http://bugzilla.nasm.us/show_bug.cgi?id=3392200
Reported-by: KO Myung-Hun <komh@chollian.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
char *tmp;
int i;
+ nasm_dump_stream(*head);
+ nasm_dump_token(*head);
+
/* Now handle token pasting... */
paste_head = NULL;
tail = head;
while (t && (t->type == TOK_WHITESPACE ||
t->type == TOK_PASTE))
t = *tail = delete_Token(t);
- if (!paste_head || !t)
- break; /* Nothing to paste with */
+ if (!t) { /* Dangling %+ term */
+ if (paste_head)
+ (*paste_head)->next = NULL;
+ else
+ *head = NULL;
+ return did_paste;
+ }
tail = paste_head;
t = *tail;
tt = t->next;