From: Wolfgang Bumiller Date: Thu, 20 Dec 2012 19:23:35 +0000 (+0100) Subject: For loops may have an empty condition - don't try processing a NULL X-Git-Tag: 0.2~47 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4f9c7861ec178d5250abb78969ee0efc0f3ac34e;p=xonotic%2Fgmqcc.git For loops may have an empty condition - don't try processing a NULL --- diff --git a/parser.c b/parser.c index 5129962..7bf7a0c 100644 --- a/parser.c +++ b/parser.c @@ -2255,9 +2255,11 @@ static bool parse_for(parser_t *parser, ast_block *block, ast_expression **out) if (!parse_statement_or_block(parser, &ontrue)) goto onerr; - cond = process_condition(parser, cond, &ifnot); - if (!cond) - goto onerr; + if (cond) { + cond = process_condition(parser, cond, &ifnot); + if (!cond) + goto onerr; + } aloop = ast_loop_new(ctx, initexpr, cond, ifnot, NULL, false, increment, ontrue); *out = (ast_expression*)aloop;