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;
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;
}
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);
}
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);