Use the current context, not the one from a NULL value... for ast_return

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-18 18:00:20 +02:00
parent 701c387dbf
commit 586bb07c4d

View file

@ -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;