mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Fix #4573
This commit is contained in:
@@ -2145,6 +2145,12 @@ gb_internal lbValue lb_emit_conv(lbProcedure *p, lbValue value, Type *t) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Type *vt : dst->Union.variants) {
|
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)) {
|
if (are_types_identical(src_type, vt)) {
|
||||||
lbAddr parent = lb_add_local_generated(p, t, true);
|
lbAddr parent = lb_add_local_generated(p, t, true);
|
||||||
lb_emit_store_union_variant(p, parent.addr, value, vt);
|
lb_emit_store_union_variant(p, parent.addr, value, vt);
|
||||||
|
|||||||
Reference in New Issue
Block a user