Fix #4573
This commit is contained in:
1 parent
168a41ba2c
commit
af37ca1286
1 file changed
+6
@@ -2145,6 +2145,12 @@ gb_internal lbValue lb_emit_conv(lbProcedure *p, lbValue value, Type *t) {
|
||||
}
|
||||
}
|
||||
for (Type *vt : dst->Union.variants) {
|
||||
if (src_type == t_llvm_bool && is_type_boolean(vt)) {
|
||||
value = lb_emit_conv(p, value, vt);
|
||||
lbAddr parent = lb_add_local_generated(p, t, true);
|
||||
lb_emit_store_union_variant(p, parent.addr, value, vt);
|
||||
return lb_addr_load(p, parent);
|
||||
}
|
||||
if (are_types_identical(src_type, vt)) {
|
||||
lbAddr parent = lb_add_local_generated(p, t, true);
|
||||
lb_emit_store_union_variant(p, parent.addr, value, vt);
|
||||
|
||||
Reference in new issue
Block a user