Skip to content

Commit f3b5894

Browse files
committed
rustc: Don't always build a constant multiply instruction when translating literal vectors; the size of the referent isn't always constant
1 parent 533dea7 commit f3b5894

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/comp/middle/trans.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4181,8 +4181,8 @@ fn trans_vec(@block_ctxt cx, vec[@ast.expr] args,
41814181
auto bcx = cx;
41824182
auto unit_sz = size_of(bcx, unit_ty);
41834183
bcx = unit_sz.bcx;
4184-
auto data_sz = llvm.LLVMConstMul(C_int(_vec.len[@ast.expr](args) as int),
4185-
unit_sz.val);
4184+
auto data_sz = bcx.build.Mul(C_int(_vec.len[@ast.expr](args) as int),
4185+
unit_sz.val);
41864186

41874187
// FIXME: pass tydesc properly.
41884188
auto sub = trans_upcall(bcx, "upcall_new_vec", vec(data_sz, C_int(0)));

0 commit comments

Comments
 (0)