From c466ac0b3ec200ac53b1ca8196c47261b692bda1 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 18 Aug 2022 11:25:20 -0400 Subject: [PATCH] add some missing assert_target_os --- src/shims/time.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shims/time.rs b/src/shims/time.rs index e495f723668d..67303c47db7e 100644 --- a/src/shims/time.rs +++ b/src/shims/time.rs @@ -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()?;