]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Fixup some possibly uninitialized value when parsing 'return'
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 18 Aug 2012 15:48:21 +0000 (17:48 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 18 Aug 2012 15:48:29 +0000 (17:48 +0200)
parser.c

index 798f2dd9e606d9b73a56628b787b02e0ac6d6d3f..90d7e862691510ecf5a84139ab25cc3c942821df 100644 (file)
--- 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))