self->varargs = NULL;
self->argc = NULL;
self->fixedparams = NULL;
+ self->return_value = NULL;
return self;
}
ast_delete(self->argc);
if (self->fixedparams)
ast_unref(self->fixedparams);
+ if (self->return_value)
+ ast_unref(self->return_value);
mem_d(self);
}
return true;
}
+ // have a local return value variable?
+ if (self->return_value) {
+ if (!ast_local_codegen(self->return_value, self->ir_func, false))
+ return false;
+ }
+
if (!vec_size(self->blocks)) {
compile_error(ast_ctx(self), "function `%s` has no body", self->name);
return false;