mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-03 17:35:28 +03:00
Rename checked_binop_checks_overflow.
This commit is contained in:
@@ -147,8 +147,9 @@ fn enforce_abi(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
/// Whether CheckedBinOp MIR statements should actually check for overflow.
|
||||
fn checked_binop_checks_overflow(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool;
|
||||
/// Whether Assert(OverflowNeg) and Assert(Overflow) MIR terminators should actually
|
||||
/// check for overflow.
|
||||
fn ignore_checkable_overflow_assertions(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool;
|
||||
|
||||
/// Entry point for obtaining the MIR of anything that should get evaluated.
|
||||
/// So not just functions and shims, but also const/static initializers, anonymous
|
||||
@@ -466,8 +467,8 @@ fn use_addr_for_alignment_check(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool {
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn checked_binop_checks_overflow(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool {
|
||||
true
|
||||
fn ignore_checkable_overflow_assertions(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
||||
@@ -137,7 +137,7 @@ pub(super) fn eval_terminator(
|
||||
}
|
||||
|
||||
Assert { ref cond, expected, ref msg, target, cleanup } => {
|
||||
let ignored = !M::checked_binop_checks_overflow(self)
|
||||
let ignored = M::ignore_checkable_overflow_assertions(self)
|
||||
&& match msg {
|
||||
mir::AssertKind::OverflowNeg(..) => true,
|
||||
mir::AssertKind::Overflow(op, ..) => op.is_checkable(),
|
||||
|
||||
@@ -815,8 +815,8 @@ fn enforce_abi(ecx: &MiriInterpCx<'mir, 'tcx>) -> bool {
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn checked_binop_checks_overflow(ecx: &MiriInterpCx<'mir, 'tcx>) -> bool {
|
||||
ecx.tcx.sess.overflow_checks()
|
||||
fn ignore_checkable_overflow_assertions(ecx: &MiriInterpCx<'mir, 'tcx>) -> bool {
|
||||
!ecx.tcx.sess.overflow_checks()
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
||||
Reference in New Issue
Block a user