Adapt interpreter.
This commit is contained in:
parent
1480b1c524
commit
7567f1f31d
2 changed files with 13 additions and 11 deletions
|
@ -569,16 +569,12 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
// checked operation, just a comparison with the minimum
|
||||
// value, so we have to check for the assert message.
|
||||
if !bx.cx().check_overflow() {
|
||||
if let AssertKind::OverflowNeg(_)
|
||||
| AssertKind::Overflow(
|
||||
mir::BinOp::Add
|
||||
| mir::BinOp::Sub
|
||||
| mir::BinOp::Mul
|
||||
| mir::BinOp::Shl
|
||||
| mir::BinOp::Shr,
|
||||
..,
|
||||
) = *msg
|
||||
{
|
||||
let unchecked_overflow = match msg {
|
||||
AssertKind::OverflowNeg(..) => true,
|
||||
AssertKind::Overflow(op, ..) => op.is_checkable(),
|
||||
_ => false,
|
||||
};
|
||||
if unchecked_overflow {
|
||||
const_cond = Some(expected);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue