Comparing Scalar's with differend defined values is false
This commit is contained in:
parent
1bd088a96c
commit
9655aaf3aa
1 changed files with 1 additions and 1 deletions
|
|
@ -327,7 +327,7 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for EvalContext<'a, 'mir, 'tcx, super:
|
|||
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)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue