Skip to content

Commit

Permalink
Auto merge of #1771 - vakaras:bug-1763, r=RalfJung
Browse files Browse the repository at this point in the history
Attempt to fix #1763

As discussed on issue #1763, just try asking the scheduler to try again.

Fixes #1763
  • Loading branch information
bors committed Apr 11, 2021
2 parents 1ae7bfc + 50f68dc commit afabaf3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,17 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
fn run_timeout_callback(&mut self) -> InterpResult<'tcx> {
let this = self.eval_context_mut();
let (thread, callback) =
this.machine.threads.get_ready_callback().expect("no callback found");
if let Some((thread, callback)) = this.machine.threads.get_ready_callback() {
(thread, callback)
} else {
// get_ready_callback can return None if the computer's clock
// was shifted after calling the scheduler and before the call
// to get_ready_callback (see issue
// https://github.com/rust-lang/miri/issues/1763). In this case,
// just do nothing, which effectively just returns to the
// scheduler.
return Ok(());
};
// This back-and-forth with `set_active_thread` is here because of two
// design decisions:
// 1. Make the caller and not the callback responsible for changing
Expand Down

0 comments on commit afabaf3

Please sign in to comment.