copying the output type on ast_array_index_codegen

This commit is contained in:
Wolfgang Bumiller 2013-01-12 15:15:58 +01:00
parent a01388ea7d
commit 5887afae62

4
ast.c
View file

@ -2253,6 +2253,8 @@ bool ast_array_index_codegen(ast_array_index *self, ast_function *func, bool lva
*out = ir_call_value(call);
self->expression.outr = *out;
(*out)->vtype = self->expression.vtype;
codegen_output_type(self, *out);
return true;
}
@ -2278,6 +2280,8 @@ bool ast_array_index_codegen(ast_array_index *self, ast_function *func, bool lva
compile_error(ast_ctx(self), "array indexing here needs an integer constant");
return false;
}
(*out)->vtype = self->expression.vtype;
codegen_output_type(self, *out);
return true;
}