Skip to content

Commit 72ca2a7

Browse files
committed
Attempt to fix #1763 by asking the scheduler to retry choosing an operation.
1 parent 1ae7bfc commit 72ca2a7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/thread.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,15 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
711711
fn run_timeout_callback(&mut self) -> InterpResult<'tcx> {
712712
let this = self.eval_context_mut();
713713
let (thread, callback) =
714-
this.machine.threads.get_ready_callback().expect("no callback found");
714+
if let Some((thread, callback)) = this.machine.threads.get_ready_callback() {
715+
(thread, callback)
716+
} else {
717+
// get_ready_callback can return None if the computer's clock was
718+
// shifted after calling the scheduler and before the call
719+
// to get_ready_callback. In this case, just do nothing, which
720+
// effectively just returns to the scheduler.
721+
return Ok(());
722+
};
715723
// This back-and-forth with `set_active_thread` is here because of two
716724
// design decisions:
717725
// 1. Make the caller and not the callback responsible for changing

0 commit comments

Comments
 (0)