From 79f4c3d002c1265220d2b39b74a7b4b37b6e2f54 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Thu, 27 Jun 2019 20:53:21 +0200 Subject: [PATCH] [WIP] --- src/base.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/base.rs b/src/base.rs index 7163c0949f7..7720296cfbf 100644 --- a/src/base.rs +++ b/src/base.rs @@ -826,14 +826,16 @@ pub fn trans_int_binop<'a, 'tcx: 'a>( } if lhs.layout().ty == fx.tcx.types.u128 || lhs.layout().ty == fx.tcx.types.i128 { - return match (bin_op, signed) { - _ => { - let layout = fx.layout_of(out_ty); - let a = fx.bcx.ins().iconst(types::I64, 42); - let b = fx.bcx.ins().iconst(types::I64, 0); - let val = fx.bcx.ins().iconcat(a, b); - CValue::by_val(val, layout) - } + if out_ty == fx.tcx.types.bool { + let layout = fx.layout_of(fx.tcx.types.bool); + let val = fx.bcx.ins().iconst(types::I8, 0); + return CValue::by_val(val, layout); + } else { + let layout = fx.layout_of(out_ty); + let a = fx.bcx.ins().iconst(types::I64, 42); + let b = fx.bcx.ins().iconst(types::I64, 0); + let val = fx.bcx.ins().iconcat(a, b); + return CValue::by_val(val, layout); } }