Skip to content

Commit 746ea5b

Browse files
committed
Auto merge of #1632 - RalfJung:rustup, r=RalfJung
rustup fix statx
2 parents c8f51fc + 697f6e3 commit 746ea5b

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bf469eb6c20ccea05400a1942c70343f36705e1c
1+
172acf8f61018df3719e42e633ffd62ebecaa1e7

src/shims/posix/fs.rs

+3-10
Original file line numberDiff line numberDiff line change
@@ -831,17 +831,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
831831
};
832832

833833
let path = this.read_path_from_c_str(pathname_scalar)?.into_owned();
834-
// `flags` should be a `c_int` but the `syscall` function provides an `isize`.
835-
let flags: i32 =
836-
this.read_scalar(flags_op)?.to_machine_isize(&*this.tcx)?.try_into().map_err(|e| {
837-
err_unsup_format!("failed to convert pointer sized operand to integer: {}", e)
838-
})?;
834+
// See <https://github.com/rust-lang/rust/pull/79196> for a discussion of argument sizes.
835+
let flags = this.read_scalar(flags_op)?.to_i32()?;
839836
let empty_path_flag = flags & this.eval_libc("AT_EMPTY_PATH")?.to_i32()? != 0;
840-
// `dirfd` should be a `c_int` but the `syscall` function provides an `isize`.
841-
let dirfd: i32 =
842-
this.read_scalar(dirfd_op)?.to_machine_isize(&*this.tcx)?.try_into().map_err(|e| {
843-
err_unsup_format!("failed to convert pointer sized operand to integer: {}", e)
844-
})?;
837+
let dirfd = this.read_scalar(dirfd_op)?.to_i32()?;
845838
// We only support:
846839
// * interpreting `path` as an absolute directory,
847840
// * interpreting `path` as a path relative to `dirfd` when the latter is `AT_FDCWD`, or

src/shims/posix/linux/foreign_items.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,8 @@ fn getrandom<'tcx>(
208208

209209
// The only supported flags are GRND_RANDOM and GRND_NONBLOCK,
210210
// neither of which have any effect on our current PRNG.
211-
let _flags = this.read_scalar(flags)?;
212-
// FIXME: Check that this is an integer type of the right size.
213-
// Currently, some callers pass i32 and some usize, is that even allowed?
211+
// See <https://github.com/rust-lang/rust/pull/79196> for a discussion of argument sizes.
212+
let _flags = this.read_scalar(flags)?.to_i32();
214213

215214
this.gen_random(ptr, len)?;
216215
this.write_scalar(Scalar::from_machine_usize(len, this), dest)?;

0 commit comments

Comments
 (0)