Prevent underflow of union padding

This commit is contained in:
korvahkh
2026-08-08 11:01:11 -05:00
parent 02246ac6fd
commit 92ec71fa75

View File

@@ -886,6 +886,8 @@ gb_internal lbValue lb_const_value(lbModule *m, Type *type, ExactValue value, lb
return res;
}
} else {
// NOTE(korvahkh): forces calculation of variant_block_size
type_size_of(bt);
i64 block_size = bt->Union.variant_block_size;
lbValue cv = lb_const_value(m, value_type, value, cc);