From 33af3208fdb2180570c3ef266abc634a45158ef1 Mon Sep 17 00:00:00 2001 From: David Renshaw Date: Sun, 14 Jan 2018 22:31:59 -0500 Subject: [PATCH] update for rust/47205 --- miri/fn_call.rs | 2 +- miri/lib.rs | 8 ++++---- miri/locks.rs | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/miri/fn_call.rs b/miri/fn_call.rs index df101739ed91..b46f712818f2 100644 --- a/miri/fn_call.rs +++ b/miri/fn_call.rs @@ -386,7 +386,7 @@ impl<'a, 'tcx> EvalContextExt<'tcx> for EvalContext<'a, 'tcx, super::Evaluator<' }; // compute global if not cached let val = match self.tcx.interpret_interner.borrow().get_cached(cid) { - Some(ptr) => ptr, + Some(ptr) => MemoryPointer::new(ptr, 0).into(), None => eval_body(self.tcx, instance, ty::ParamEnv::empty(traits::Reveal::All))?.0, }; let val = self.value_to_primval(ValTy { value: Value::ByRef(val, name_align), diff --git a/miri/lib.rs b/miri/lib.rs index 9f6550ac072e..92ae0ab8a820 100644 --- a/miri/lib.rs +++ b/miri/lib.rs @@ -203,7 +203,7 @@ pub struct MemoryData<'tcx> { /// /// Only mutable (static mut, heap, stack) allocations have an entry in this map. /// The entry is created when allocating the memory and deleted after deallocation. - locks: HashMap>>, + locks: HashMap>>, } impl<'tcx> Machine<'tcx> for Evaluator<'tcx> { @@ -324,7 +324,7 @@ impl<'tcx> Machine<'tcx> for Evaluator<'tcx> { instance, promoted: None, }, - ptr.into(), + ptr.alloc_id, ); Ok(()) } @@ -340,14 +340,14 @@ impl<'tcx> Machine<'tcx> for Evaluator<'tcx> { fn add_lock<'a>( mem: &mut Memory<'a, 'tcx, Self>, - id: u64, + id: AllocId, ) { mem.data.locks.insert(id, RangeMap::new()); } fn free_lock<'a>( mem: &mut Memory<'a, 'tcx, Self>, - id: u64, + id: AllocId, len: u64, ) -> EvalResult<'tcx> { mem.data.locks diff --git a/miri/locks.rs b/miri/locks.rs index 3a9df6a38dff..f0e8815c4fc5 100644 --- a/miri/locks.rs +++ b/miri/locks.rs @@ -109,7 +109,7 @@ impl<'a, 'tcx: 'a> MemoryExt<'tcx> for Memory<'a, 'tcx, Evaluator<'tcx>> { if len == 0 { return Ok(()); } - let locks = match self.data.locks.get(&ptr.alloc_id.0) { + let locks = match self.data.locks.get(&ptr.alloc_id) { Some(locks) => locks, // immutable static or other constant memory None => return Ok(()), @@ -148,7 +148,7 @@ impl<'a, 'tcx: 'a> MemoryExt<'tcx> for Memory<'a, 'tcx, Evaluator<'tcx>> { ); self.check_bounds(ptr.offset(len, &*self)?, true)?; // if ptr.offset is in bounds, then so is ptr (because offset checks for overflow) - let locks = match self.data.locks.get_mut(&ptr.alloc_id.0) { + let locks = match self.data.locks.get_mut(&ptr.alloc_id) { Some(locks) => locks, // immutable static or other constant memory None => return Ok(()), @@ -197,7 +197,7 @@ impl<'a, 'tcx: 'a> MemoryExt<'tcx> for Memory<'a, 'tcx, Evaluator<'tcx>> { ) -> EvalResult<'tcx> { assert!(len > 0); let cur_frame = self.cur_frame; - let locks = match self.data.locks.get_mut(&ptr.alloc_id.0) { + let locks = match self.data.locks.get_mut(&ptr.alloc_id) { Some(locks) => locks, // immutable static or other constant memory None => return Ok(()), @@ -275,7 +275,7 @@ impl<'a, 'tcx: 'a> MemoryExt<'tcx> for Memory<'a, 'tcx, Evaluator<'tcx>> { frame: cur_frame, path: lock_path.clone(), }; - let locks = match self.data.locks.get_mut(&ptr.alloc_id.0) { + let locks = match self.data.locks.get_mut(&ptr.alloc_id) { Some(locks) => locks, // immutable static or other constant memory None => return Ok(()),