]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Fix: check error before calling codegen_output_type
authorWolfgang (Blub) Bumiller <blub@speed.at>
Mon, 17 Dec 2012 14:43:14 +0000 (15:43 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Mon, 17 Dec 2012 14:43:14 +0000 (15:43 +0100)
ast.c

diff --git a/ast.c b/ast.c
index 993ef38bdc51da1dfa91d8f617049b07f4d09006..bdb9408e9d60a59988b178625b32896958338b6d 100644 (file)
--- 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;