interpret: fix CheckedBinOp behavior when overflow checking is disabled
This commit is contained in:
parent
e1d1848cc6
commit
6f01ff61b3
3 changed files with 14 additions and 2 deletions
|
@ -185,7 +185,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
let left = self.read_immediate(&self.eval_operand(left, None)?)?;
|
||||
let layout = binop_right_homogeneous(bin_op).then_some(left.layout);
|
||||
let right = self.read_immediate(&self.eval_operand(right, layout)?)?;
|
||||
self.binop_with_overflow(bin_op, &left, &right, &dest)?;
|
||||
self.binop_with_overflow(
|
||||
bin_op, /*force_overflow_checks*/ false, &left, &right, &dest,
|
||||
)?;
|
||||
}
|
||||
|
||||
UnaryOp(un_op, ref operand) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue