aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-parser.c
diff options
context:
space:
mode:
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>2005-10-14 21:35:47 +0000
committerVolker Reichelt <reichelt@gcc.gnu.org>2005-10-14 21:35:47 +0000
commit24871154f324e06395e8db9038dfc6276cb6d4a7 (patch)
tree30cd3681486ae4b2227a082c326aee6d97bb53a6 /gcc/c-parser.c
parent3c955a0481f042373c9390273a4560d08455d51f (diff)
downloadgcc-24871154f324e06395e8db9038dfc6276cb6d4a7.zip
gcc-24871154f324e06395e8db9038dfc6276cb6d4a7.tar.gz
gcc-24871154f324e06395e8db9038dfc6276cb6d4a7.tar.bz2
re PR c/23439 ("f(){for" crashes the C frontend)
PR c/23439 * c-parser.c (c_parser_for_statement): Use location of RID_FOR to initialize loc. * gcc.dg/for-1.c: New test. From-SVN: r105422
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r--gcc/c-parser.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index ce03569..518a92c 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -3776,8 +3776,9 @@ static void
c_parser_for_statement (c_parser *parser)
{
tree block, cond, incr, save_break, save_cont, body;
- location_t loc = UNKNOWN_LOCATION;
+ location_t loc;
gcc_assert (c_parser_next_token_is_keyword (parser, RID_FOR));
+ loc = c_parser_peek_token (parser)->location;
c_parser_consume_token (parser);
block = c_begin_compound_stmt (flag_isoc99);
if (c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>"))