Skip to content

Commit 9cc4e5d

Browse files
committed
---
yaml --- r: 16122 b: refs/heads/try c: ea8d4d7 h: refs/heads/master v: v3
1 parent 22f6222 commit 9cc4e5d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 1eebb1fe871addca6c7dcdfb43d0b8693e08b783
5+
refs/heads/try: ea8d4d7f1719a53c066713e6893b33556b69dbfe
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rustc/middle/trans/base.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2521,7 +2521,9 @@ fn trans_index(cx: block, ex: @ast::expr, base: @ast::expr,
25212521
let ix_size = llsize_of_real(cx.ccx(), val_ty(ix.val));
25222522
let int_size = llsize_of_real(cx.ccx(), ccx.int_type);
25232523
let ix_val = if ix_size < int_size {
2524-
ZExt(bcx, ix.val, ccx.int_type)
2524+
if ty::type_is_signed(expr_ty(cx, idx)) {
2525+
SExt(bcx, ix.val, ccx.int_type)
2526+
} else { ZExt(bcx, ix.val, ccx.int_type) }
25252527
} else if ix_size > int_size {
25262528
Trunc(bcx, ix.val, ccx.int_type)
25272529
} else {

0 commit comments

Comments
 (0)