]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Storing ir_v for functions
authorWolfgang Bumiller <wolfgang.linux@bumiller.com>
Wed, 4 Jul 2012 13:00:30 +0000 (15:00 +0200)
committerWolfgang Bumiller <wolfgang.linux@bumiller.com>
Wed, 4 Jul 2012 13:00:30 +0000 (15:00 +0200)
ast.c

diff --git a/ast.c b/ast.c
index 4a546415b3d6e71977921af404a340d71e94c00f..d22e23919fcf0b85e0a146116c5cb889e534fe1f 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -491,8 +491,10 @@ bool ast_value_codegen(ast_value *self, ast_function *func, bool lvalue, ir_valu
      * and the ast-user should take care of ast_global_codegen to be used
      * on all the globals.
      */
-    if (!self->ir_v)
+    if (!self->ir_v) {
+        printf("ast_value used before generated (%s)\n", self->name);
         return false;
+    }
     *out = self->ir_v;
     return true;
 }
@@ -507,6 +509,7 @@ bool ast_global_codegen(ast_value *self, ir_builder *ir)
             return false;
 
         self->constval.vfunc->ir_func = func;
+        self->ir_v = func->value;
         /* The function is filled later on ast_function_codegen... */
         return true;
     }