}
MEM_VEC_FUNCTIONS(ast_block, ast_value*, locals)
MEM_VEC_FUNCTIONS(ast_block, ast_expression*, exprs)
+MEM_VEC_FUNCTIONS(ast_block, ast_expression*, collect)
void ast_block_delete(ast_block *self)
{
size_t i;
+ for (i = 0; i < self->collect_count; ++i)
+ ast_unref(self->collect[i]);
+ MEM_VECTOR_CLEAR(self, collect);
for (i = 0; i < self->exprs_count; ++i)
ast_unref(self->exprs[i]);
MEM_VECTOR_CLEAR(self, exprs);
*out = ir_block_create_load_from_ent(func->curblock, ast_function_label(func, "efv"),
ent, field, self->expression.vtype);
}
- if (!*out)
+ if (!*out) {
+ asterror(ast_ctx(self), "failed to create %s instruction (output type %s)",
+ (lvalue ? "ADDRESS" : "FIELD"),
+ type_name[self->expression.vtype]);
return false;
+ }
if (lvalue)
self->expression.outl = *out;