Skip to content

Commit

Permalink
Replace match with expect()
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed Aug 4, 2019
1 parent c2f681f commit 6f00c21
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
}
let this = self.eval_context_mut();

let ptr = match this.memory().check_ptr_access(ptr, Size::from_bytes(len as u64), Align::from_bytes(1).unwrap())? {
Some(ptr) => ptr,
None => return Ok(()), // zero-sized access
};
let ptr = this.memory().check_ptr_access(ptr, Size::from_bytes(len as u64), Align::from_bytes(1).unwrap())?.expect("we already checked for size 0");

let rng = this.memory_mut().extra.rng.get_mut();
let mut data = vec![0; len];
Expand Down

0 comments on commit 6f00c21

Please sign in to comment.