]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Actually generate the missing return instruction
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 30 Nov 2012 11:35:33 +0000 (12:35 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 30 Nov 2012 11:35:33 +0000 (12:35 +0100)
ast.c

diff --git a/ast.c b/ast.c
index ead4ea93975056d8decb0a7bdc8b7b194c8785d1..22081b5c5e0568dbf251213a7c9c5c464d894f6b 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1446,9 +1446,6 @@ bool ast_function_codegen(ast_function *self, ir_builder *ir)
     /* TODO: check return types */
     if (!self->curblock->is_return)
     {
-        /*
-        return ir_block_create_return(self->curblock, NULL);
-        */
         if (!self->vtype->expression.next ||
             self->vtype->expression.next->expression.vtype == TYPE_VOID)
         {
@@ -1463,6 +1460,7 @@ bool ast_function_codegen(ast_function *self, ir_builder *ir)
             {
                 return false;
             }
+            return ir_block_create_return(self->curblock, NULL);
         }
     }
     return true;