Skip to content

Commit c466ac0

Browse files
committed
add some missing assert_target_os
1 parent d34242e commit c466ac0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/shims/time.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
197197
fn nanosleep(
198198
&mut self,
199199
req_op: &OpTy<'tcx, Provenance>,
200-
_rem: &OpTy<'tcx, Provenance>,
200+
_rem: &OpTy<'tcx, Provenance>, // Signal handlers are not supported, so rem will never be written to.
201201
) -> InterpResult<'tcx, i32> {
202-
// Signal handlers are not supported, so rem will never be written to.
203-
204202
let this = self.eval_context_mut();
205203

204+
this.assert_target_os_is_unix("nanosleep");
206205
this.check_no_isolation("`nanosleep`")?;
207206

208207
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
238237
fn Sleep(&mut self, timeout: &OpTy<'tcx, Provenance>) -> InterpResult<'tcx> {
239238
let this = self.eval_context_mut();
240239

240+
this.assert_target_os("windows", "Sleep");
241241
this.check_no_isolation("`Sleep`")?;
242242

243243
let timeout_ms = this.read_scalar(timeout)?.to_u32()?;

0 commit comments

Comments
 (0)