mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-01 04:20:09 +08:00
tccpp.c: fix endless loop
Perhaps a better fix would be to ensure tok is set to TOK_EOF rather than 0 at the end of a macro stream. This partially fixes test2 of the examples given in: http://lists.nongnu.org/archive/html/tinycc-devel/2015-05/msg00002.html It's still failing, but at least it's not running out of memory now.
This commit is contained in:
parent
1e878200f7
commit
a3d78b95d7
5
tccpp.c
5
tccpp.c
@ -2930,8 +2930,9 @@ static int macro_subst_tok(TokenString *tok_str,
|
|||||||
/* NOTE: non zero sa->t indicates VA_ARGS */
|
/* NOTE: non zero sa->t indicates VA_ARGS */
|
||||||
while ((parlevel > 0 ||
|
while ((parlevel > 0 ||
|
||||||
(tok != ')' &&
|
(tok != ')' &&
|
||||||
(tok != ',' || sa->type.t))) &&
|
(tok != ',' || sa->type.t)))) {
|
||||||
tok != -1) {
|
if (tok == TOK_EOF || tok == 0)
|
||||||
|
break;
|
||||||
if (tok == '(')
|
if (tok == '(')
|
||||||
parlevel++;
|
parlevel++;
|
||||||
else if (tok == ')')
|
else if (tok == ')')
|
||||||
|
Loading…
Reference in New Issue
Block a user