From 2cf4895cc778d77d59802125432d78137d7769c6 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Sat, 18 Aug 2012 17:48:21 +0200 Subject: [PATCH] Fixup some possibly uninitialized value when parsing 'return' --- parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parser.c b/parser.c index 798f2dd..90d7e86 100644 --- a/parser.c +++ b/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)) -- 2.39.2