Skip to content

Commit 517728b

Browse files
committed
avoid fallback logic (and we do not need the flag value currently anyway)
1 parent cdb7adb commit 517728b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/shims/posix/linux/foreign_items.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,9 @@ 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-
// Either `i32` or `isize` is fine.
213-
if flags.to_machine_isize(this).is_err() {
214-
flags.to_i32()?;
215-
}
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?
216214

217215
this.gen_random(ptr, len)?;
218216
this.write_scalar(Scalar::from_machine_usize(len, this), dest)?;

0 commit comments

Comments
 (0)