From: Wolfgang (Blub) Bumiller Date: Fri, 30 Nov 2012 20:34:49 +0000 (+0100) Subject: bodyless loops still have to loop X-Git-Tag: 0.1.9~154 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d148cfdcd5b668b6aa0110d59fe73bc46a17eee5;p=xonotic%2Fgmqcc.git bodyless loops still have to loop --- diff --git a/ast.c b/ast.c index 5d824d0..40a53a3 100644 --- a/ast.c +++ b/ast.c @@ -2420,7 +2420,7 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value bbreak = bout; /* The loop body... */ - if (self->body) + /* if (self->body) */ { bbody = ir_function_create_block(ast_ctx(self), func->ir_func, ast_function_label(func, "loop_body")); if (!bbody) @@ -2437,9 +2437,11 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value func->continueblock = bbody; /* generate */ - cgen = self->body->expression.codegen; - if (!(*cgen)((ast_expression*)(self->body), func, false, &dummy)) - return false; + if (self->body) { + cgen = self->body->expression.codegen; + if (!(*cgen)((ast_expression*)(self->body), func, false, &dummy)) + return false; + } end_bbody = func->curblock; func->breakblock = old_bbreak;