rustc: load bools as unsigned numbers.

Apparently loading them signed will break if/when they become i1.
This commit is contained in:
Huon Wilson 2014-02-08 12:12:47 +11:00
parent 285c25f7f4
commit 5e2de79b30

View File

@ -545,7 +545,7 @@ fn load<'a>(bcx: &'a Block<'a>, llptr: ValueRef, ty: ty::t) -> ValueRef {
if type_is_zero_size(bcx.ccx(), ty) {
C_undef(type_of::type_of(bcx.ccx(), ty))
} else if ty::type_is_bool(ty) {
LoadRangeAssert(bcx, llptr, 0, 2, lib::llvm::True)
LoadRangeAssert(bcx, llptr, 0, 2, lib::llvm::False)
} else if ty::type_is_char(ty) {
// a char is a unicode codepoint, and so takes values from 0
// to 0x10FFFF inclusive only.