From 2815bb7fd434614620604823e35182424e1ec32f Mon Sep 17 00:00:00 2001 From: Elichai Turkel Date: Thu, 13 Feb 2020 18:38:59 +0200 Subject: [PATCH] Fix exact_div to indetify MIN % -1 --- src/librustc_mir/interpret/operator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_mir/interpret/operator.rs b/src/librustc_mir/interpret/operator.rs index 2e8c94903ca46..3ef0c26fcfb1c 100644 --- a/src/librustc_mir/interpret/operator.rs +++ b/src/librustc_mir/interpret/operator.rs @@ -201,7 +201,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { match bin_op { Rem => { if r == -1 && l == (1 << (size.bits() - 1)) { - return Ok((Scalar::from_int(0, size), true, left_layout.ty)); + return Ok((Scalar::from_uint(l, size), true, left_layout.ty)); } } _ => {}