Skip to content

Commit f8478df

Browse files
committed
Bump rustc for permissive provenance
1 parent d76c2c5 commit f8478df

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
481db40311cdd241ae4d33f34f2f75732e44d8e8
1+
2d691170885b32502b391b8b1a0d54d2419a5653

src/machine.rs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ impl Provenance for Tag {
158158
write!(f, "{:?}", tag.sb)
159159
}
160160

161-
fn get_alloc_id(self) -> AllocId {
162-
self.alloc_id
161+
fn get_alloc_id(self) -> Option<AllocId> {
162+
Some(self.alloc_id)
163163
}
164164
}
165165

@@ -600,21 +600,37 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
600600
}
601601

602602
#[inline(always)]
603-
fn ptr_from_addr(
603+
fn ptr_from_addr_cast(
604604
ecx: &MiriEvalContext<'mir, 'tcx>,
605605
addr: u64,
606606
) -> Pointer<Option<Self::PointerTag>> {
607607
intptrcast::GlobalStateInner::ptr_from_addr(addr, ecx)
608608
}
609609

610+
#[inline(always)]
611+
fn ptr_from_addr_transmute(
612+
ecx: &MiriEvalContext<'mir, 'tcx>,
613+
addr: u64,
614+
) -> Pointer<Option<Self::PointerTag>> {
615+
Self::ptr_from_addr_cast(ecx, addr)
616+
}
617+
618+
#[inline(always)]
619+
fn expose_ptr(
620+
_ecx: &mut InterpCx<'mir, 'tcx, Self>,
621+
_ptr: Pointer<Self::PointerTag>,
622+
) -> InterpResult<'tcx> {
623+
Ok(())
624+
}
625+
610626
/// Convert a pointer with provenance into an allocation-offset pair,
611627
/// or a `None` with an absolute address if that conversion is not possible.
612628
fn ptr_get_alloc(
613629
ecx: &MiriEvalContext<'mir, 'tcx>,
614630
ptr: Pointer<Self::PointerTag>,
615-
) -> (AllocId, Size, Self::TagExtra) {
631+
) -> Option<(AllocId, Size, Self::TagExtra)> {
616632
let rel = intptrcast::GlobalStateInner::abs_ptr_to_rel(ecx, ptr);
617-
(ptr.provenance.alloc_id, rel, ptr.provenance.sb)
633+
Some((ptr.provenance.alloc_id, rel, ptr.provenance.sb))
618634
}
619635

620636
#[inline(always)]

0 commit comments

Comments
 (0)