@@ -323,15 +323,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
323323 // FIXME: we should set last_error, but to what?
324324 this. write_null ( dest) ?;
325325 }
326- // this is only callable from std because we know that std ignores the return value
327- "SwitchToThread" if this. frame_in_std ( ) => {
328- let [ ] = this. check_shim ( abi, Abi :: System { unwind : false } , link_name, args) ?;
329-
330- this. yield_active_thread ( ) ;
331-
332- // FIXME: this should return a nonzero value if this call does result in switching to another thread.
333- this. write_null ( dest) ?;
334- }
335326 "GetStdHandle" => {
336327 let [ which] =
337328 this. check_shim ( abi, Abi :: System { unwind : false } , link_name, args) ?;
@@ -417,6 +408,15 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
417408 let result = this. GetCurrentProcessId ( ) ?;
418409 this. write_scalar ( Scalar :: from_u32 ( result) , dest) ?;
419410 }
411+ // this is only callable from std because we know that std ignores the return value
412+ "SwitchToThread" if this. frame_in_std ( ) => {
413+ let [ ] = this. check_shim ( abi, Abi :: System { unwind : false } , link_name, args) ?;
414+
415+ this. yield_active_thread ( ) ;
416+
417+ // FIXME: this should return a nonzero value if this call does result in switching to another thread.
418+ this. write_null ( dest) ?;
419+ }
420420
421421 _ => return Ok ( EmulateByNameResult :: NotSupported ) ,
422422 }
0 commit comments