Skip to content

Commit 04c937e

Browse files
committed
assert platform in time shims
1 parent 4608b94 commit 04c937e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/shims/time.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
2121
let this = self.eval_context_mut();
2222

2323
this.check_no_isolation("clock_gettime")?;
24+
this.assert_platform("linux");
2425

2526
let clk_id = this.read_scalar(clk_id_op)?.to_i32()?;
2627
let tp = this.deref_operand(tp_op)?;
@@ -58,6 +59,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
5859
let this = self.eval_context_mut();
5960

6061
this.check_no_isolation("gettimeofday")?;
62+
this.assert_platform("macos");
63+
6164
// Using tz is obsolete and should always be null
6265
let tz = this.read_scalar(tz_op)?.not_undef()?;
6366
if !this.is_null(tz)? {

0 commit comments

Comments
 (0)