Skip to content

Commit 43c9196

Browse files
committed
---
yaml --- r: 1581 b: refs/heads/master c: ea2c868 h: refs/heads/master i: 1579: 2a81baf v: v3
1 parent 4c1efa8 commit 43c9196

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 1e65baad94ca8ae1f96472bf9efeb8e5ae04cf26
2+
refs/heads/master: ea2c86874448439a31012ccb141450c67e3d94d8

trunk/src/comp/middle/trans.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1020,9 +1020,17 @@ fn dynamic_size_of(@block_ctxt cx, @ty.t t) -> result {
10201020
let ValueRef max_size = bcx.build.Alloca(T_int());
10211021
bcx.build.Store(C_int(0), max_size);
10221022

1023+
auto ty_params = tag_ty_params(bcx.fcx.ccx, tid);
10231024
auto variants = tag_variants(bcx.fcx.ccx, tid);
10241025
for (ast.variant variant in variants) {
1025-
let vec[@ty.t] tys = variant_types(bcx.fcx.ccx, variant);
1026+
// Perform type substitution on the raw variant types.
1027+
let vec[@ty.t] raw_tys = variant_types(bcx.fcx.ccx, variant);
1028+
let vec[@ty.t] tys = vec();
1029+
for (@ty.t raw_ty in raw_tys) {
1030+
auto t = ty.substitute_ty_params(ty_params, tps, raw_ty);
1031+
tys += vec(t);
1032+
}
1033+
10261034
auto rslt = align_elements(bcx, tys);
10271035
bcx = rslt.bcx;
10281036

0 commit comments

Comments
 (0)