From: Wolfgang Bumiller Date: Tue, 7 May 2013 18:35:20 +0000 (+0200) Subject: less confusing X-Git-Tag: v0.3.0~151^2~49 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a0fa90ddd555f7d55042b0fb542e63e6b10ad7e2;p=xonotic%2Fgmqcc.git less confusing --- diff --git a/parser.c b/parser.c index c95ff91..4d50bad 100644 --- a/parser.c +++ b/parser.c @@ -2779,7 +2779,6 @@ static bool parse_for_go(parser_t *parser, ast_block *block, ast_expression **ou ast_expression *initexpr, *cond, *increment, *ontrue; ast_value *typevar; - bool retval = true; bool ifnot = false; lex_ctx ctx = parser_ctx(parser); @@ -2879,9 +2878,11 @@ static bool parse_for_go(parser_t *parser, ast_block *block, ast_expression **ou aloop = ast_loop_new(ctx, initexpr, cond, ifnot, NULL, false, increment, ontrue); *out = (ast_expression*)aloop; - if (!parser_leaveblock(parser)) - retval = false; - return retval; + if (!parser_leaveblock(parser)) { + ast_delete(aloop); + return false; + } + return true; onerr: if (initexpr) ast_unref(initexpr); if (cond) ast_unref(cond);