Skip to content

Commit d2dee4b

Browse files
committed
make SwitchToThread only callable from std
1 parent fc65b15 commit d2dee4b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/shims/windows/foreign_items.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
372372
// FIXME: we should set last_error, but to what?
373373
this.write_null(dest)?;
374374
}
375-
"SwitchToThread" => {
375+
// this is only callable from std because we know that std ignores the return value
376+
"SwitchToThread" if this.frame_in_std() => {
376377
let [] = this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
377378

378379
this.yield_active_thread();

0 commit comments

Comments
 (0)