Skip to content

Commit 6d88a47

Browse files
committed
restrict stat shim to macos only
1 parent 75f7a11 commit 6d88a47

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/shims/fs.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
268268
) -> InterpResult<'tcx, i32> {
269269
let this = self.eval_context_mut();
270270

271+
if this.tcx.sess.target.target.target_os.to_lowercase() != "macos" {
272+
throw_unsup_format!("The `stat` shim is only only available in the `macos` platform.")
273+
}
274+
271275
let path_scalar = this.read_scalar(path_op)?.not_undef()?;
272276
let path = this.read_os_str_from_c_str(path_scalar)?;
273277

0 commit comments

Comments
 (0)