Use unsigned_abs throughout repository
This commit is contained in:
parent
85394252e6
commit
edf2e3725e
5 changed files with 6 additions and 15 deletions
|
@ -7,7 +7,7 @@ use std::convert::TryFrom;
|
|||
use rustc_hir::def_id::DefId;
|
||||
use rustc_middle::mir::{
|
||||
self,
|
||||
interpret::{uabs, ConstValue, GlobalId, InterpResult, Scalar},
|
||||
interpret::{ConstValue, GlobalId, InterpResult, Scalar},
|
||||
BinOp,
|
||||
};
|
||||
use rustc_middle::ty;
|
||||
|
@ -542,7 +542,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
// memory between these pointers must be accessible. Note that we do not require the
|
||||
// pointers to be properly aligned (unlike a read/write operation).
|
||||
let min_ptr = if offset_bytes >= 0 { ptr } else { offset_ptr };
|
||||
let size: u64 = uabs(offset_bytes);
|
||||
let size = offset_bytes.unsigned_abs();
|
||||
// This call handles checking for integer/NULL pointers.
|
||||
self.memory.check_ptr_access_align(
|
||||
min_ptr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue