]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Use the current context, not the one from a NULL value... for ast_return
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 18 Aug 2012 16:00:20 +0000 (18:00 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 18 Aug 2012 16:00:20 +0000 (18:00 +0200)
parser.c

index a901c4094d91ff90329b5bbba0cb3c8176842cce..5fb87651e80abf25221cbe9a7225cb569e7410e6 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1618,7 +1618,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");
                 }
-                ret = ast_return_new(exp->expression.node.context, NULL);
+                ret = ast_return_new(parser_ctx(parser), NULL);
             }
             *out = (ast_expression*)ret;
             return true;