On Fri, 18 Nov 2016, David Malcolm wrote:
> + /* Consume all tokens, up to the closing brace, handling
> + matching pairs of braces in the rtl dump. */
> + int num_open_braces = 1;
> + while (1)
> + {
> + switch (c_parser_peek_token (parser)->type)
> + {
> + case CPP_OPEN_BRACE:
> + num_open_braces++;
> + break;
> + case CPP_CLOSE_BRACE:
> + if (--num_open_braces == 0)
> + goto found_closing_brace;
> + break;
> + default:
> + break;
> + }
> + c_parser_consume_token (parser);
> + }
What if you have an EOF without the close brace being found? I'd expect
you to hit the
gcc_assert (parser->tokens[0].type != CPP_EOF);
in c_parser_consume_token.
--
Joseph S. Myers
[email protected]