Rollup merge of #98888 - RalfJung:interpret-checked-bin, r=oli-obk
interpret: fix CheckedBinOp behavior when overflow checking is disabled Adjusts the interpreter to https://github.com/rust-lang/rust/pull/98738. r? `@oli-obk`
This commit is contained in:
@@ -144,6 +144,9 @@ pub trait Machine<'mir, 'tcx>: Sized {
|
||||
true
|
||||
}
|
||||
|
||||
/// Whether CheckedBinOp MIR statements should actually check for overflow.
|
||||
fn check_binop_checks_overflow(_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
|
||||
/// constants, ...
|
||||
@@ -468,6 +471,11 @@ pub macro compile_time_machine(<$mir: lifetime, $tcx: lifetime>) {
|
||||
true
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn check_binop_checks_overflow(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn call_extra_fn(
|
||||
_ecx: &mut InterpCx<$mir, $tcx, Self>,
|
||||
|
||||
Reference in New Issue
Block a user