mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 06:28:20 +03:00
Auto merge of #2116 - carbotaniuman:minimal-miri-changes, r=RalfJung
Minimal miri changes for rustc permissive provenance Simple no-op changes to adapt to new API surface.
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
481db40311cdd241ae4d33f34f2f75732e44d8e8
|
||||
2d691170885b32502b391b8b1a0d54d2419a5653
|
||||
|
||||
+21
-5
@@ -159,8 +159,8 @@ fn fmt(ptr: &Pointer<Self>, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{:?}", tag.sb)
|
||||
}
|
||||
|
||||
fn get_alloc_id(self) -> AllocId {
|
||||
self.alloc_id
|
||||
fn get_alloc_id(self) -> Option<AllocId> {
|
||||
Some(self.alloc_id)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -608,21 +608,37 @@ fn tag_alloc_base_pointer(
|
||||
}
|
||||
|
||||
#[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)]
|
||||
|
||||
Reference in New Issue
Block a user