@@ -213,11 +213,11 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
213
213
"syscall" => {
214
214
let sys_getrandom = this. eval_path_scalar ( & [ "libc" , "SYS_getrandom" ] ) ?
215
215
. expect ( "Failed to get libc::SYS_getrandom" )
216
- . to_usize ( this) ? as i64 ;
216
+ . to_usize ( this) ?;
217
217
218
218
// `libc::syscall(NR_GETRANDOM, buf.as_mut_ptr(), buf.len(), GRND_NONBLOCK)`
219
219
// is called if a `HashMap` is created the regular way (e.g. HashMap<K, V>).
220
- match this. read_scalar ( args[ 0 ] ) ?. to_usize ( this) ? as i64 {
220
+ match this. read_scalar ( args[ 0 ] ) ?. to_usize ( this) ? {
221
221
id if id == sys_getrandom => {
222
222
let ptr = this. read_scalar ( args[ 1 ] ) ?. to_ptr ( ) ?;
223
223
let len = this. read_scalar ( args[ 2 ] ) ?. to_usize ( this) ?;
@@ -795,13 +795,15 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
795
795
}
796
796
}
797
797
798
- fn gen_random < ' a , ' mir , ' tcx > ( this : & mut MiriEvalContext < ' a , ' mir , ' tcx > ,
799
- len : usize ) -> Result < Vec < u8 > , EvalError < ' tcx > > {
798
+ fn gen_random < ' a , ' mir , ' tcx > (
799
+ this : & mut MiriEvalContext < ' a , ' mir , ' tcx > ,
800
+ len : usize ,
801
+ ) -> Result < Vec < u8 > , EvalError < ' tcx > > {
800
802
801
- match this. machine . rng . as_ref ( ) {
803
+ match & mut this. machine . rng {
802
804
Some ( rng) => {
803
805
let mut data = vec ! [ 0 ; len] ;
804
- rng. borrow_mut ( ) . fill_bytes ( & mut data) ;
806
+ rng. fill_bytes ( & mut data) ;
805
807
Ok ( data)
806
808
}
807
809
None => {
0 commit comments