]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
call ir_function_finalize on array accessors otherwise they'll blow up stuff
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 11 Nov 2012 22:46:03 +0000 (23:46 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 11 Nov 2012 22:46:03 +0000 (23:46 +0100)
ast.c
exec.c
parser.c

diff --git a/ast.c b/ast.c
index 89da314f114b03b28d442c4fae1b685425b5ef8d..e1d8b797bd92da343699e3d0355096b85d156341 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1160,12 +1160,14 @@ bool ast_local_codegen(ast_value *self, ir_function *func, bool param)
 
     if (self->setter) {
         if (!ast_global_codegen(self->setter, func->owner, false) ||
-            !ast_function_codegen(self->setter->constval.vfunc, func->owner))
+            !ast_function_codegen(self->setter->constval.vfunc, func->owner) ||
+            !ir_function_finalize(self->setter->constval.vfunc->ir_func))
             return false;
     }
     if (self->getter) {
         if (!ast_global_codegen(self->getter, func->owner, false) ||
-            !ast_function_codegen(self->getter->constval.vfunc, func->owner))
+            !ast_function_codegen(self->getter->constval.vfunc, func->owner) ||
+            !ir_function_finalize(self->getter->constval.vfunc->ir_func))
             return false;
     }
     return true;
diff --git a/exec.c b/exec.c
index 508bdbf857fa0e82be8c81256d3cedaae4cf5260..c90444ad180831e65a6debc635f920d00b8aefba 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -1300,7 +1300,7 @@ while (1) {
 
                        if(!OPA->function || OPA->function >= (unsigned int)prog->functions_count)
                        {
-                               qcvmerror(prog, "CALL outside the program in `%s`", prog->filename);
+                               qcvmerror(prog, "CALL outside the program in `%s` (%i)", prog->filename, (int)OPA->function);
                                goto cleanup;
                        }
 
index 1bd22059f850e088caac594ec8e7bfccd9c58ce1..7b7805f4f439e6c5709c42bb924f17616be193c8 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -3586,7 +3586,8 @@ bool parser_finish(const char *output)
             asvalue = (ast_value*)(parser->globals[i].var);
             if (asvalue->setter) {
                 if (!ast_global_codegen(asvalue->setter, ir, false) ||
-                    !ast_function_codegen(asvalue->setter->constval.vfunc, ir))
+                    !ast_function_codegen(asvalue->setter->constval.vfunc, ir) ||
+                    !ir_function_finalize(asvalue->setter->constval.vfunc->ir_func))
                 {
                     printf("failed to generate setter for %s\n", parser->globals[i].name);
                     ir_builder_delete(ir);
@@ -3595,7 +3596,8 @@ bool parser_finish(const char *output)
             }
             if (asvalue->getter) {
                 if (!ast_global_codegen(asvalue->getter, ir, false) ||
-                    !ast_function_codegen(asvalue->getter->constval.vfunc, ir))
+                    !ast_function_codegen(asvalue->getter->constval.vfunc, ir) ||
+                    !ir_function_finalize(asvalue->getter->constval.vfunc->ir_func))
                 {
                     printf("failed to generate getter for %s\n", parser->globals[i].name);
                     ir_builder_delete(ir);