mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-24 04:41:25 +00:00
For loops may have an empty condition - don't try processing a NULL
This commit is contained in:
parent
a985a5cab1
commit
4f9c7861ec
1 changed files with 5 additions and 3 deletions
8
parser.c
8
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))
|
if (!parse_statement_or_block(parser, &ontrue))
|
||||||
goto onerr;
|
goto onerr;
|
||||||
|
|
||||||
cond = process_condition(parser, cond, &ifnot);
|
if (cond) {
|
||||||
if (!cond)
|
cond = process_condition(parser, cond, &ifnot);
|
||||||
goto onerr;
|
if (!cond)
|
||||||
|
goto onerr;
|
||||||
|
}
|
||||||
aloop = ast_loop_new(ctx, initexpr, cond, ifnot, NULL, false, increment, ontrue);
|
aloop = ast_loop_new(ctx, initexpr, cond, ifnot, NULL, false, increment, ontrue);
|
||||||
*out = (ast_expression*)aloop;
|
*out = (ast_expression*)aloop;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue