Fix #2594 zero sized union code generation

This commit is contained in:
gingerBill
2023-06-26 17:36:27 +01:00
parent cdcb64b0d0
commit 8b8310711e
3 changed files with 6 additions and 4 deletions
+1
View File
@@ -1323,6 +1323,7 @@ gb_internal lbValue lb_emit_union_tag_value(lbProcedure *p, lbValue u) {
gb_internal void lb_emit_store_union_variant_tag(lbProcedure *p, lbValue parent, Type *variant_type) {
Type *t = type_deref(parent.type);
GB_ASSERT(is_type_union(t));
if (is_type_union_maybe_pointer(t) || type_size_of(t) == 0) {
// No tag needed!