Skip to content

Commit

Permalink
tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Oct 10, 2018
1 parent 9a9dbff commit bc9435d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/librustc_mir/interpret/memory.rs
Expand Up @@ -313,7 +313,12 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {

/// Check if the memory range beginning at `ptr` and of size `Size` is "in-bounds".
#[inline(always)]
pub fn check_bounds(&self, ptr: Pointer<M::PointerTag>, size: Size, access: bool) -> EvalResult<'tcx> {
pub fn check_bounds(
&self,
ptr: Pointer<M::PointerTag>,
size: Size,
access: bool
) -> EvalResult<'tcx> {
// if ptr.offset is in bounds, then so is ptr (because offset checks for overflow)
self.check_bounds_ptr(ptr.offset(size, &*self)?, access)
}
Expand Down

0 comments on commit bc9435d

Please sign in to comment.