From eab1050ba4034442708292e7879cd34ed7371681 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Mon, 17 Dec 2012 15:43:14 +0100 Subject: [PATCH] Fix: check error before calling codegen_output_type --- ast.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ast.c b/ast.c index 993ef38..bdb9408 100644 --- a/ast.c +++ b/ast.c @@ -2002,7 +2002,9 @@ bool ast_entfield_codegen(ast_entfield *self, ast_function *func, bool lvalue, i } else { *out = ir_block_create_load_from_ent(func->curblock, ast_ctx(self), ast_function_label(func, "efv"), ent, field, self->expression.vtype); + /* Done AFTER error checking: codegen_output_type(self, *out); + */ } if (!*out) { compile_error(ast_ctx(self), "failed to create %s instruction (output type %s)", @@ -2010,6 +2012,8 @@ bool ast_entfield_codegen(ast_entfield *self, ast_function *func, bool lvalue, i type_name[self->expression.vtype]); return false; } + if (!lvalue) + codegen_output_type(self, *out); if (lvalue) self->expression.outl = *out; -- 2.39.2