aboutsummaryrefslogtreecommitdiff
path: root/src/ir.c
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-05-04 23:18:54 +0100
committerGinger Bill <bill@gingerbill.org>2017-05-04 23:18:54 +0100
commit51ea59d76a3e0ee72a9a3bb59bd61845dea64e5e (patch)
tree2cd3a1f7db2fa4992f291940efdb39926a9c26bd /src/ir.c
parent789b297f324206a18128f61679bfd36b9c6265b2 (diff)
Fix calculation of vector type sizes
Diffstat (limited to 'src/ir.c')
-rw-r--r--src/ir.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ir.c b/src/ir.c
index 956877ff8..bb9d8b7e8 100644
--- a/src/ir.c
+++ b/src/ir.c
@@ -5203,7 +5203,9 @@ irAddr ir_build_addr(irProcedure *proc, AstNode *expr) {
}
field = st->fields[index];
- if (!is_union && ir_is_elem_const(proc->module, elem, field->type)) {
+ Type *ft = field->type;
+ if (!is_union && !is_type_union(ft) &&
+ ir_is_elem_const(proc->module, elem, ft)) {
continue;
}
@@ -5211,7 +5213,9 @@ irAddr ir_build_addr(irProcedure *proc, AstNode *expr) {
GB_ASSERT(ir_type(field_expr)->kind != Type_Tuple);
- Type *ft = field->type;
+ if (is_type_union(ft)) {
+ // gb_printf_err("HERE! %s\n", type_to_string(ft));
+ }
irValue *fv = ir_emit_conv(proc, field_expr, ft);
irValue *gep = ir_emit_struct_ep(proc, v, index);
ir_emit_store(proc, gep, fv);