diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2012-03-04 13:05:55 +0400 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2012-03-04 13:05:55 +0400 |
commit | 65ff09a9d8159f36b135de98b03f288fda95b1a0 (patch) | |
tree | 0cb06c79e58bfbc8048f9f9f8dfd54591c5ff388 /preproc.c | |
parent | fec39dc93a6b6b49a7986f56f8d7f6a4f91faf3f (diff) | |
download | nasm-65ff09a9d8159f36b135de98b03f288fda95b1a0.tar.gz nasm-65ff09a9d8159f36b135de98b03f288fda95b1a0.tar.bz2 nasm-65ff09a9d8159f36b135de98b03f288fda95b1a0.zip |
BR3392200: preproc - Fix dangling paste term
Backport 99a055add917fe954038885d9013f8968f76790c
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'preproc.c')
-rw-r--r-- | preproc.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -3678,8 +3678,13 @@ static bool paste_tokens(Token **head, const struct tokseq_match *m, 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; |