Contracts core intrinsics.
These are hooks to: 1. control whether contract checks are run 2. allow 3rd party tools to intercept and reintepret the results of running contracts.
This commit is contained in:
parent
534d79adf9
commit
bcb8565f30
30 changed files with 183 additions and 6 deletions
|
|
@ -179,7 +179,7 @@ fn check_rvalue<'tcx>(
|
|||
))
|
||||
}
|
||||
},
|
||||
Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf | NullOp::OffsetOf(_) | NullOp::UbChecks, _)
|
||||
Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf | NullOp::OffsetOf(_) | NullOp::UbChecks | NullOp::ContractChecks, _)
|
||||
| Rvalue::ShallowInitBox(_, _) => Ok(()),
|
||||
Rvalue::UnaryOp(_, operand) => {
|
||||
let ty = operand.ty(body, tcx);
|
||||
|
|
|
|||
|
|
@ -1150,6 +1150,11 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
|
|||
interp_ok(ecx.tcx.sess.ub_checks())
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn contract_checks(ecx: &InterpCx<'tcx, Self>) -> InterpResult<'tcx, bool> {
|
||||
interp_ok(ecx.tcx.sess.contract_checks())
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn thread_local_static_pointer(
|
||||
ecx: &mut MiriInterpCx<'tcx>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue