diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-05-04 23:18:54 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-05-04 23:18:54 +0100 |
| commit | 51ea59d76a3e0ee72a9a3bb59bd61845dea64e5e (patch) | |
| tree | 2cd3a1f7db2fa4992f291940efdb39926a9c26bd /src/ir.c | |
| parent | 789b297f324206a18128f61679bfd36b9c6265b2 (diff) | |
Fix calculation of vector type sizes
Diffstat (limited to 'src/ir.c')
| -rw-r--r-- | src/ir.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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); |