Fix 'RtlGenRandom' argument slots

This commit is contained in:
Aaron Hill 2019-04-08 23:18:10 -04:00
parent 5e07ff6b1f
commit 6b4c5b81da
No known key found for this signature in database
GPG key ID: B4087E510E98B164

View file

@ -756,8 +756,8 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
}
// The actual name of 'RtlGenRandom'
"SystemFunction036" => {
let ptr = this.read_scalar(args[1])?.to_ptr()?;
let len = this.read_scalar(args[2])?.to_usize(this)?;
let ptr = this.read_scalar(args[0])?.to_ptr()?;
let len = this.read_scalar(args[1])?.to_usize(this)?;
let data = gen_random(this, len as usize)?;
this.memory_mut().get_mut(ptr.alloc_id)?