From: Wolfgang (Blub) Bumiller Date: Sun, 11 Nov 2012 22:46:03 +0000 (+0100) Subject: call ir_function_finalize on array accessors otherwise they'll blow up stuff X-Git-Tag: 0.1~19^2~18 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=83438d9833d07895c8e97f5c5083c00f0ae57b1c;p=xonotic%2Fgmqcc.git call ir_function_finalize on array accessors otherwise they'll blow up stuff --- diff --git a/ast.c b/ast.c index 89da314..e1d8b79 100644 --- 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 508bdbf..c90444a 100644 --- 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; } diff --git a/parser.c b/parser.c index 1bd2205..7b7805f 100644 --- 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);