mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-23 11:11:22 +00:00
Fix: check error before calling codegen_output_type
This commit is contained in:
parent
05ccb73e08
commit
eab1050ba4
1 changed files with 4 additions and 0 deletions
4
ast.c
4
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;
|
||||
|
|
Loading…
Reference in a new issue