mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-22 10:41:43 +00:00
Fixup some possibly uninitialized value when parsing 'return'
This commit is contained in:
parent
e239d2a33b
commit
2cf4895cc7
1 changed files with 2 additions and 1 deletions
3
parser.c
3
parser.c
|
@ -1619,6 +1619,7 @@ static bool parser_parse_statement(parser_t *parser, ast_block *block, ast_expre
|
|||
if (expected->expression.next->expression.vtype != TYPE_VOID) {
|
||||
parseerror(parser, "return without value");
|
||||
}
|
||||
*out = NULL;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -1723,7 +1724,7 @@ cleanup:
|
|||
|
||||
static ast_expression* parser_parse_statement_or_block(parser_t *parser)
|
||||
{
|
||||
ast_expression *expr;
|
||||
ast_expression *expr = NULL;
|
||||
if (parser->tok == '{')
|
||||
return (ast_expression*)parser_parse_block(parser);
|
||||
if (!parser_parse_statement(parser, NULL, &expr))
|
||||
|
|
Loading…
Reference in a new issue