mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Fix assertion on union assignment in compound literal
This commit is contained in:
+1
-3
@@ -7027,9 +7027,7 @@ irAddr ir_build_addr(irProcedure *proc, Ast *expr) {
|
|||||||
|
|
||||||
Type *fet = ir_type(field_expr);
|
Type *fet = ir_type(field_expr);
|
||||||
// HACK TODO(bill): THIS IS A MASSIVE HACK!!!!
|
// HACK TODO(bill): THIS IS A MASSIVE HACK!!!!
|
||||||
if (is_type_union(ft) && !are_types_identical(fet, ft)) {
|
if (is_type_union(ft) && !are_types_identical(fet, ft) && !is_type_untyped(fet)) {
|
||||||
GB_ASSERT(union_variant_index(ft, fet) > 0);
|
|
||||||
|
|
||||||
irValue *gep = ir_emit_struct_ep(proc, v, cast(i32)index);
|
irValue *gep = ir_emit_struct_ep(proc, v, cast(i32)index);
|
||||||
ir_emit_store_union_variant(proc, gep, field_expr, fet);
|
ir_emit_store_union_variant(proc, gep, field_expr, fet);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user