Skip to content

Commit 95b3f69

Browse files
committed
---
yaml --- r: 146305 b: refs/heads/try2 c: afab330 h: refs/heads/master i: 146303: 173ba87 v: v3
1 parent 30e6f09 commit 95b3f69

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: fcfbfde0b71d2470cb544d3d216eaf61ceb348bf
8+
refs/heads/try2: afab3307a03c3227706b634b731363004c33a0ac
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/trans/expr.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,9 +1726,14 @@ fn trans_imm_cast(bcx: @mut Block, expr: &ast::Expr,
17261726
(cast_enum, cast_float) => {
17271727
let bcx = bcx;
17281728
let repr = adt::represent_type(ccx, t_in);
1729-
let slot = Alloca(bcx, ll_t_in, "");
1730-
Store(bcx, llexpr, slot);
1731-
let lldiscrim_a = adt::trans_get_discr(bcx, repr, slot, Some(Type::i64()));
1729+
let llexpr_ptr;
1730+
if type_is_immediate(ccx, t_in) {
1731+
llexpr_ptr = Alloca(bcx, ll_t_in, "");
1732+
Store(bcx, llexpr, llexpr_ptr);
1733+
} else {
1734+
llexpr_ptr = llexpr;
1735+
}
1736+
let lldiscrim_a = adt::trans_get_discr(bcx, repr, llexpr_ptr, Some(Type::i64()));
17321737
match k_out {
17331738
cast_integral => int_cast(bcx, ll_t_out,
17341739
val_ty(lldiscrim_a),

0 commit comments

Comments
 (0)