Skip to content

Commit 781f9d2

Browse files
committed
refactor ub_checks and contract_checks to share logic
1 parent abfd2a2 commit 781f9d2

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/machine.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,13 +1329,8 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
13291329
}
13301330

13311331
#[inline(always)]
1332-
fn ub_checks(ecx: &InterpCx<'tcx, Self>) -> InterpResult<'tcx, bool> {
1333-
interp_ok(ecx.tcx.sess.ub_checks())
1334-
}
1335-
1336-
#[inline(always)]
1337-
fn contract_checks(ecx: &InterpCx<'tcx, Self>) -> InterpResult<'tcx, bool> {
1338-
interp_ok(ecx.tcx.sess.contract_checks())
1332+
fn runtime_checks(ecx: &InterpCx<'tcx, Self>, r: mir::RuntimeChecks) -> InterpResult<'tcx, bool> {
1333+
interp_ok(r.value(&ecx.tcx.sess))
13391334
}
13401335

13411336
#[inline(always)]

0 commit comments

Comments
 (0)