diff options
| author | Patrick Walton <[email protected]> | 2011-03-01 16:49:05 -0800 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-03-01 16:49:05 -0800 |
| commit | 9d59d33515d889f6e65f50226ba83d91a36bba0e (patch) | |
| tree | 571ed5859658b71c8863d782865303a83c164e7a /src/comp | |
| parent | rustc: Add logic for generic tags to dynamic_size_of(). (diff) | |
| download | rust-9d59d33515d889f6e65f50226ba83d91a36bba0e.tar.xz rust-9d59d33515d889f6e65f50226ba83d91a36bba0e.zip | |
rustc: Add in the size of the discriminant to generic_size_of() for tags
Diffstat (limited to 'src/comp')
| -rw-r--r-- | src/comp/middle/trans.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index ed61fdd7..0aaf582d 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -909,7 +909,9 @@ fn dynamic_size_of(@block_ctxt cx, @ty.t t) -> result { bcx.build.Store(umax(bcx, this_size, old_max_size), max_size); } - ret res(bcx, bcx.build.Load(max_size)); + auto max_size_val = bcx.build.Load(max_size); + auto total_size = bcx.build.Add(max_size_val, llsize_of(T_int())); + ret res(bcx, total_size); } } } |