Skip to content

Commit 1839ec5

Browse files
committed
Consistently use C_uint_big for discriminants
1 parent b7c8cc4 commit 1839ec5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/librustc_trans/mir/place.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc::mir::tcx::PlaceTy;
1616
use rustc_data_structures::indexed_vec::Idx;
1717
use base;
1818
use builder::Builder;
19-
use common::{CodegenCx, C_undef, C_usize, C_u8, C_u32, C_uint, C_int, C_null, C_uint_big};
19+
use common::{CodegenCx, C_undef, C_usize, C_u8, C_u32, C_uint, C_null, C_uint_big};
2020
use consts;
2121
use type_of::LayoutLlvmExt;
2222
use type_::Type;
@@ -331,9 +331,11 @@ impl<'a, 'tcx> PlaceRef<'tcx> {
331331
let ptr = self.project_field(bx, 0);
332332
let to = self.layout.ty.ty_adt_def().unwrap()
333333
.discriminant_for_variant(bx.tcx(), variant_index)
334-
.val as u64;
335-
bx.store(C_int(ptr.layout.llvm_type(bx.cx), to as i64),
336-
ptr.llval, ptr.align);
334+
.val;
335+
bx.store(
336+
C_uint_big(ptr.layout.llvm_type(bx.cx), to),
337+
ptr.llval,
338+
ptr.align);
337339
}
338340
layout::Variants::NicheFilling {
339341
dataful_variant,

0 commit comments

Comments
 (0)