add some missing assert_target_os

This commit is contained in:
Ralf Jung 2022-08-18 11:25:20 -04:00
parent d34242e8f1
commit c466ac0b3e

View file

@ -197,12 +197,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
fn nanosleep(
&mut self,
req_op: &OpTy<'tcx, Provenance>,
_rem: &OpTy<'tcx, Provenance>,
_rem: &OpTy<'tcx, Provenance>, // Signal handlers are not supported, so rem will never be written to.
) -> InterpResult<'tcx, i32> {
// Signal handlers are not supported, so rem will never be written to.
let this = self.eval_context_mut();
this.assert_target_os_is_unix("nanosleep");
this.check_no_isolation("`nanosleep`")?;
let duration = match this.read_timespec(&this.deref_operand(req_op)?)? {
@ -238,6 +237,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
fn Sleep(&mut self, timeout: &OpTy<'tcx, Provenance>) -> InterpResult<'tcx> {
let this = self.eval_context_mut();
this.assert_target_os("windows", "Sleep");
this.check_no_isolation("`Sleep`")?;
let timeout_ms = this.read_scalar(timeout)?.to_u32()?;