Skip to content

Commit 8731b63

Browse files
committed
fix: missed add Os::Linux for supported OSs in fstat
1 parent abefc0b commit 8731b63

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/shims/unix/fs.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -586,19 +586,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
586586
interp_ok(Scalar::from_i32(this.write_stat_buf(metadata, buf_op)?))
587587
}
588588

589-
fn fstat(
590-
&mut self,
591-
fd_op: &OpTy<'tcx>,
592-
buf_op: &OpTy<'tcx>,
593-
) -> InterpResult<'tcx, Scalar> {
589+
fn fstat(&mut self, fd_op: &OpTy<'tcx>, buf_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar> {
594590
let this = self.eval_context_mut();
595591

596-
if !matches!(&this.tcx.sess.target.os, Os::MacOs | Os::FreeBsd | Os::Solaris | Os::Illumos)
597-
{
598-
panic!(
599-
"`macos_fbsd_solaris_fstat` should not be called on {}",
600-
this.tcx.sess.target.os
601-
);
592+
if !matches!(
593+
&this.tcx.sess.target.os,
594+
Os::MacOs | Os::FreeBsd | Os::Solaris | Os::Illumos | Os::Linux
595+
) {
596+
panic!("`fstat` should not be called on {}", this.tcx.sess.target.os);
602597
}
603598

604599
let fd = this.read_scalar(fd_op)?.to_i32()?;

0 commit comments

Comments
 (0)