add extra sanity check against depending on system time with isolation enabled
This commit is contained in:
parent
bc307b40ba
commit
613a436cfc
2 changed files with 4 additions and 0 deletions
|
|
@ -869,6 +869,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||
callback: TimeoutCallback<'mir, 'tcx>,
|
||||
) {
|
||||
let this = self.eval_context_mut();
|
||||
if !this.machine.communicate() && matches!(call_time, Time::RealTime(..)) {
|
||||
panic!("cannot have `RealTime` callback with isolation enabled!")
|
||||
}
|
||||
this.machine.threads.register_timeout_callback(thread, call_time, callback);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1036,6 +1036,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
|
|||
// These are our preemption points.
|
||||
ecx.maybe_preempt_active_thread();
|
||||
|
||||
// Make sure some time passes.
|
||||
ecx.machine.clock.tick();
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue