]> git.lizzy.rs Git - rust.git/commitdiff
Comparing Scalar's with differend `defined` values is false
authorOliver Schneider <github35764891676564198441@oli-obk.de>
Wed, 30 May 2018 12:29:54 +0000 (14:29 +0200)
committerOliver Schneider <github35764891676564198441@oli-obk.de>
Sun, 3 Jun 2018 11:08:51 +0000 (13:08 +0200)
src/intrinsic.rs

index 3d537ea629c3b83b77e9db890fc515e364e463cd..1e8090dc1897624284a7b22d00107668a5042429 100644 (file)
@@ -327,7 +327,7 @@ fn call_intrinsic(
                 let a = self.value_to_scalar(args[0])?;
                 let b = self.value_to_scalar(args[1])?;
                 // check x % y != 0
-                if self.binary_op(mir::BinOp::Rem, a, ty, b, ty)?.0 != Scalar::null() {
+                if !self.binary_op(mir::BinOp::Rem, a, ty, b, ty)?.0.is_null()? {
                     return err!(ValidationFailure(format!("exact_div: {:?} cannot be divided by {:?}", a, b)));
                 }
                 let result = self.binary_op(mir::BinOp::Div, a, ty, b, ty)?;