Skip to content

Commit

Permalink
fix RtlGenRandom argument size
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Apr 16, 2019
1 parent 6fdc750 commit 6211178
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fn_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
// The actual name of 'RtlGenRandom'
"SystemFunction036" => {
let ptr = this.read_scalar(args[0])?.to_ptr()?;
let len = this.read_scalar(args[1])?.to_usize(this)?;
let len = this.read_scalar(args[1])?.to_u32(this)?;

if len > 0 {
let data = gen_random(this, len as usize)?;
Expand Down

0 comments on commit 6211178

Please sign in to comment.