aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorBarinzaya <barinzaya@gmail.com>2025-05-05 16:37:02 -0400
committerBarinzaya <barinzaya@gmail.com>2025-05-05 16:37:02 -0400
commit981437065968214430a2f958705affa9a15a09ae (patch)
treee629da0bfd4c9ff6629ef4e1ef3d8c4ffcccca9e /src/types.cpp
parentb0f53a6eaf8fcfeaffce84c9077c6955df222788 (diff)
parent2224911aca77d15cfdb5ae19e16e9c88ed6edea9 (diff)
Merge branch 'master' into core-simd-indices-redadd-redmul
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/types.cpp b/src/types.cpp
index 9c9472a28..393e35ca1 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -4108,10 +4108,10 @@ gb_internal i64 type_size_of_internal(Type *t, TypePath *path) {
}
i64 max = 0;
- i64 field_size = 0;
for_array(i, t->Union.variants) {
Type *variant_type = t->Union.variants[i];
+
i64 size = type_size_of_internal(variant_type, path);
if (max < size) {
max = size;
@@ -4130,7 +4130,7 @@ gb_internal i64 type_size_of_internal(Type *t, TypePath *path) {
size = align_formula(max, tag_size);
// NOTE(bill): Calculate the padding between the common fields and the tag
t->Union.tag_size = cast(i16)tag_size;
- t->Union.variant_block_size = size - field_size;
+ t->Union.variant_block_size = size;
size += tag_size;
}