rustc: Move type_of() behind the check for dynamic size in trans_vec()

This commit is contained in:
Patrick Walton 2011-03-18 16:34:22 -07:00
parent 78bcfe28f2
commit 533dea772f
1 changed files with 1 additions and 1 deletions

View File

@ -4178,7 +4178,6 @@ fn trans_vec(@block_ctxt cx, vec[@ast.expr] args,
}
}
auto llunit_ty = type_of(cx.fcx.ccx, unit_ty);
auto bcx = cx;
auto unit_sz = size_of(bcx, unit_ty);
bcx = unit_sz.bcx;
@ -4222,6 +4221,7 @@ fn trans_vec(@block_ctxt cx, vec[@ast.expr] args,
auto dst_val;
if (!ty.type_has_dynamic_size(unit_ty)) {
auto llunit_ty = type_of(cx.fcx.ccx, unit_ty);
dst_val = bcx.build.PointerCast(dst_res.val, T_ptr(llunit_ty));
} else {
dst_val = dst_res.val;