Auto merge of #1632 - RalfJung:rustup, r=RalfJung

rustup

fix statx
This commit is contained in:
bors 2020-11-20 13:08:30 +00:00
commit 746ea5b141
3 changed files with 6 additions and 14 deletions

View File

@ -1 +1 @@
bf469eb6c20ccea05400a1942c70343f36705e1c 172acf8f61018df3719e42e633ffd62ebecaa1e7

View File

@ -831,17 +831,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
}; };
let path = this.read_path_from_c_str(pathname_scalar)?.into_owned(); let path = this.read_path_from_c_str(pathname_scalar)?.into_owned();
// `flags` should be a `c_int` but the `syscall` function provides an `isize`. // See <https://github.com/rust-lang/rust/pull/79196> for a discussion of argument sizes.
let flags: i32 = let flags = this.read_scalar(flags_op)?.to_i32()?;
this.read_scalar(flags_op)?.to_machine_isize(&*this.tcx)?.try_into().map_err(|e| {
err_unsup_format!("failed to convert pointer sized operand to integer: {}", e)
})?;
let empty_path_flag = flags & this.eval_libc("AT_EMPTY_PATH")?.to_i32()? != 0; let empty_path_flag = flags & this.eval_libc("AT_EMPTY_PATH")?.to_i32()? != 0;
// `dirfd` should be a `c_int` but the `syscall` function provides an `isize`. let dirfd = this.read_scalar(dirfd_op)?.to_i32()?;
let dirfd: i32 =
this.read_scalar(dirfd_op)?.to_machine_isize(&*this.tcx)?.try_into().map_err(|e| {
err_unsup_format!("failed to convert pointer sized operand to integer: {}", e)
})?;
// We only support: // We only support:
// * interpreting `path` as an absolute directory, // * interpreting `path` as an absolute directory,
// * interpreting `path` as a path relative to `dirfd` when the latter is `AT_FDCWD`, or // * interpreting `path` as a path relative to `dirfd` when the latter is `AT_FDCWD`, or

View File

@ -208,9 +208,8 @@ fn getrandom<'tcx>(
// The only supported flags are GRND_RANDOM and GRND_NONBLOCK, // The only supported flags are GRND_RANDOM and GRND_NONBLOCK,
// neither of which have any effect on our current PRNG. // neither of which have any effect on our current PRNG.
let _flags = this.read_scalar(flags)?; // See <https://github.com/rust-lang/rust/pull/79196> for a discussion of argument sizes.
// FIXME: Check that this is an integer type of the right size. let _flags = this.read_scalar(flags)?.to_i32();
// Currently, some callers pass i32 and some usize, is that even allowed?
this.gen_random(ptr, len)?; this.gen_random(ptr, len)?;
this.write_scalar(Scalar::from_machine_usize(len, this), dest)?; this.write_scalar(Scalar::from_machine_usize(len, this), dest)?;