From: Dale Weiler Date: Fri, 30 Jan 2015 04:33:59 +0000 (-0500) Subject: Fix for loops X-Git-Tag: xonotic-v0.8.1~2 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=commitdiff_plain;h=41a76ab91dc6f872b03cd64f51aba86578f330c0;ds=sidebyside Fix for loops --- diff --git a/parser.c b/parser.c index 0b78337..672ce86 100644 --- a/parser.c +++ b/parser.c @@ -2595,6 +2595,11 @@ static bool parse_for_go(parser_t *parser, ast_block *block, ast_expression **ou goto onerr; } + if (!parser_next(parser)) { + parseerror(parser, "expected for-loop condition"); + goto onerr; + } + } else { if (!parser_next(parser)) { parseerror(parser, "expected for-loop condition"); goto onerr; @@ -2607,7 +2612,6 @@ static bool parse_for_go(parser_t *parser, ast_block *block, ast_expression **ou if (!cond) goto onerr; } - /* move on to incrementor */ if (parser->tok != ';') { parseerror(parser, "expected semicolon after for-loop initializer");