Skip to content

Commit 9d59d33

Browse files
committed
rustc: Add in the size of the discriminant to generic_size_of() for tags
1 parent 71f853b commit 9d59d33

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/comp/middle/trans.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,9 @@ fn dynamic_size_of(@block_ctxt cx, @ty.t t) -> result {
909909
bcx.build.Store(umax(bcx, this_size, old_max_size), max_size);
910910
}
911911

912-
ret res(bcx, bcx.build.Load(max_size));
912+
auto max_size_val = bcx.build.Load(max_size);
913+
auto total_size = bcx.build.Add(max_size_val, llsize_of(T_int()));
914+
ret res(bcx, total_size);
913915
}
914916
}
915917
}

0 commit comments

Comments
 (0)