Skip to content

Commit

Permalink
Bump rustc
Browse files Browse the repository at this point in the history
  • Loading branch information
carbotaniuman committed May 14, 2022
1 parent 5887b2b commit 32f4362
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8fbd92d0b95d847c68948d8dbbfaccb470db4f92
2d691170885b32502b391b8b1a0d54d2419a5653
26 changes: 21 additions & 5 deletions src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ impl Provenance for Tag {
write!(f, "{:?}", tag.sb)
}

fn get_alloc_id(self) -> AllocId {
self.alloc_id
fn get_alloc_id(self) -> Option<AllocId> {
Some(self.alloc_id)
}
}

Expand Down Expand Up @@ -604,21 +604,37 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
}

#[inline(always)]
fn ptr_from_addr(
fn ptr_from_addr_cast(
ecx: &MiriEvalContext<'mir, 'tcx>,
addr: u64,
) -> Pointer<Option<Self::PointerTag>> {
intptrcast::GlobalStateInner::ptr_from_addr(addr, ecx)
}

#[inline(always)]
fn ptr_from_addr_transmute(
ecx: &MiriEvalContext<'mir, 'tcx>,
addr: u64,
) -> Pointer<Option<Self::PointerTag>> {
Self::ptr_from_addr_cast(ecx, addr)
}

#[inline(always)]
fn expose_ptr(
ecx: &mut InterpCx<'mir, 'tcx, Self>,
ptr: Pointer<Self::PointerTag>,
) -> InterpResult<'tcx> {
Ok(())
}

/// Convert a pointer with provenance into an allocation-offset pair,
/// or a `None` with an absolute address if that conversion is not possible.
fn ptr_get_alloc(
ecx: &MiriEvalContext<'mir, 'tcx>,
ptr: Pointer<Self::PointerTag>,
) -> (AllocId, Size, Self::TagExtra) {
) -> Option<(AllocId, Size, Self::TagExtra)> {
let rel = intptrcast::GlobalStateInner::abs_ptr_to_rel(ecx, ptr);
(ptr.provenance.alloc_id, rel, ptr.provenance.sb)
Some((ptr.provenance.alloc_id, rel, ptr.provenance.sb))
}

#[inline(always)]
Expand Down

0 comments on commit 32f4362

Please sign in to comment.