BR3392200: preproc - Fix dangling paste term
Backport 99a055add9
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
fec39dc93a
commit
65ff09a9d8
1 changed files with 7 additions and 2 deletions
|
@ -3678,8 +3678,13 @@ static bool paste_tokens(Token **head, const struct tokseq_match *m,
|
||||||
while (t && (t->type == TOK_WHITESPACE ||
|
while (t && (t->type == TOK_WHITESPACE ||
|
||||||
t->type == TOK_PASTE))
|
t->type == TOK_PASTE))
|
||||||
t = *tail = delete_Token(t);
|
t = *tail = delete_Token(t);
|
||||||
if (!paste_head || !t)
|
if (!t) { /* Dangling %+ term */
|
||||||
break; /* Nothing to paste with */
|
if (paste_head)
|
||||||
|
(*paste_head)->next = NULL;
|
||||||
|
else
|
||||||
|
*head = NULL;
|
||||||
|
return did_paste;
|
||||||
|
}
|
||||||
tail = paste_head;
|
tail = paste_head;
|
||||||
t = *tail;
|
t = *tail;
|
||||||
tt = t->next;
|
tt = t->next;
|
||||||
|
|
Loading…
Reference in a new issue