From: Dale Weiler Date: Fri, 9 Jan 2015 04:42:46 +0000 (-0500) Subject: Fix variable declarations in for-loop initializers X-Git-Tag: xonotic-v0.8.1~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=114a1d3b14119460e85597eeda4f2d2c8ed956b3;p=xonotic%2Fgmqcc.git Fix variable declarations in for-loop initializers --- diff --git a/parser.c b/parser.c index 4a09583..b629c87 100644 --- a/parser.c +++ b/parser.c @@ -2588,16 +2588,17 @@ static bool parse_for_go(parser_t *parser, ast_block *block, ast_expression **ou initexpr = parse_expression_leave(parser, false, false, false); if (!initexpr) goto onerr; - } - /* move on to condition */ - if (parser->tok != ';') { - parseerror(parser, "expected semicolon after for-loop initializer"); - goto onerr; - } - if (!parser_next(parser)) { - parseerror(parser, "expected for-loop condition"); - goto onerr; + /* move on to condition */ + if (parser->tok != ';') { + parseerror(parser, "expected semicolon after for-loop initializer"); + goto onerr; + } + + if (!parser_next(parser)) { + parseerror(parser, "expected for-loop condition"); + goto onerr; + } } /* parse the condition */