mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 21:47:15 +03:00
@@ -294,7 +294,7 @@ fn emulate_foreign_item(
|
||||
match this.read_scalar(args[0])?.to_usize(this)? {
|
||||
id if id == sys_getrandom => {
|
||||
// The first argument is the syscall id,
|
||||
// so skip over it
|
||||
// so skip over it.
|
||||
linux_getrandom(this, &args[1..], dest)?;
|
||||
}
|
||||
id => {
|
||||
@@ -968,7 +968,7 @@ fn eval_path_scalar(&mut self, path: &[&str]) -> InterpResult<'tcx, Option<Scala
|
||||
}
|
||||
}
|
||||
|
||||
// Shims the linux 'getrandom()' syscall
|
||||
// Shims the linux 'getrandom()' syscall.
|
||||
fn linux_getrandom<'tcx>(
|
||||
this: &mut MiriEvalContext<'_, 'tcx>,
|
||||
args: &[OpTy<'tcx, Tag>],
|
||||
@@ -978,7 +978,7 @@ fn linux_getrandom<'tcx>(
|
||||
let len = this.read_scalar(args[1])?.to_usize(this)?;
|
||||
|
||||
// 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(args[2])?.to_i32()?;
|
||||
|
||||
this.gen_random(ptr, len as usize)?;
|
||||
|
||||
Reference in New Issue
Block a user