]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
ast_loop with no condition and no incrementor are 'for(;;)' and need to loop endlessl...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 30 Nov 2012 11:28:51 +0000 (12:28 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 30 Nov 2012 11:28:51 +0000 (12:28 +0100)
ast.c

diff --git a/ast.c b/ast.c
index 417fc15acbf6b01814da15fc7df974e890f199a8..ead4ea93975056d8decb0a7bdc8b7b194c8785d1 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1458,8 +1458,8 @@ bool ast_function_codegen(ast_function *self, ir_builder *ir)
         {
             /* error("missing return"); */
             if (compile_warning(ast_ctx(self), WARN_MISSING_RETURN_VALUES,
-                                "control reaches end of non-void function (`%s`)",
-                                self->name))
+                                "control reaches end of non-void function (`%s`) via %s",
+                                self->name, self->curblock->label))
             {
                 return false;
             }
@@ -2475,7 +2475,7 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value
         if      (bincrement) tmpblock = bincrement;
         else if (bpostcond)  tmpblock = bpostcond;
         else if (bprecond)   tmpblock = bprecond;
-        else                 tmpblock = bout;
+        else                 tmpblock = bbody;
         if (!end_bbody->final && !ir_block_create_jump(end_bbody, tmpblock))
             return false;
     }