]> git.lizzy.rs Git - rust.git/commitdiff
avoid fallback logic (and we do not need the flag value currently anyway)
authorRalf Jung <post@ralfj.de>
Thu, 19 Nov 2020 08:36:06 +0000 (09:36 +0100)
committerRalf Jung <post@ralfj.de>
Thu, 19 Nov 2020 08:36:33 +0000 (09:36 +0100)
src/shims/posix/linux/foreign_items.rs

index 21d765621f7313d97981db59ae8bf61d0297fffa..23dc02a6affd30976a95ae7780fffa1e4130acca 100644 (file)
@@ -208,11 +208,9 @@ fn getrandom<'tcx>(
 
     // The only supported flags are GRND_RANDOM and GRND_NONBLOCK,
     // neither of which have any effect on our current PRNG.
-    let flags = this.read_scalar(flags)?;
-    // Either `i32` or `isize` is fine.
-    if flags.to_machine_isize(this).is_err() {
-        flags.to_i32()?;
-    }
+    let _flags = this.read_scalar(flags)?;
+    // FIXME: Check that this is an integer type of the right size.
+    // Currently, some callers pass i32 and some usize, is that even allowed?
 
     this.gen_random(ptr, len)?;
     this.write_scalar(Scalar::from_machine_usize(len, this), dest)?;