Skip to content

Commit 8450ab9

Browse files
committed
rustc: Fix a level-of-indirection problem by using size_of() to compute dynamically sized interior vector element sizes instead of field_of_tydesc()
1 parent f5d604f commit 8450ab9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/comp/middle/trans.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1407,11 +1407,9 @@ fn dynamic_size_of(&@block_ctxt cx, ty::t t) -> result {
14071407
ret rslt(bcx, total_size);
14081408
}
14091409
case (ty::ty_ivec(?mt)) {
1410-
auto rs = field_of_tydesc(cx, mt.ty, false,
1411-
abi::tydesc_field_size);
1410+
auto rs = size_of(cx, mt.ty);
14121411
auto bcx = rs.bcx;
1413-
auto llunitszptr = rs.val;
1414-
auto llunitsz = bcx.build.Load(llunitszptr);
1412+
auto llunitsz = rs.val;
14151413
auto llsz = bcx.build.Add(llsize_of(T_opaque_ivec()),
14161414
bcx.build.Mul(llunitsz, C_uint(abi::ivec_default_length)));
14171415
ret rslt(bcx, llsz);

0 commit comments

Comments
 (0)