use super::{
AllocId, Allocation, AllocationExtra, CheckInAllocMsg, Frame, ImmTy, InterpCx, InterpResult,
- Memory, MemoryKind, OpTy, Operand, PlaceTy, Pointer, Scalar,
+ LocalValue, MemPlace, Memory, MemoryKind, OpTy, Operand, PlaceTy, Pointer, Scalar,
};
/// Data returned by Machine::stack_pop,
) -> InterpResult<'tcx>;
/// Called to read the specified `local` from the `frame`.
+ /// Since reading a ZST is not actually accessing memory or locals, this is never invoked
+ /// for ZST reads.
#[inline]
fn access_local(
_ecx: &InterpCx<'mir, 'tcx, Self>,
frame.locals[local].access()
}
+ /// Called to write the specified `local` from the `frame`.
+ /// Since writing a ZST is not actually accessing memory or locals, this is never invoked
+ /// for ZST reads.
+ #[inline]
+ fn access_local_mut<'a>(
+ ecx: &'a mut InterpCx<'mir, 'tcx, Self>,
+ frame: usize,
+ local: mir::Local,
+ ) -> InterpResult<'tcx, Result<&'a mut LocalValue<Self::PointerTag>, MemPlace<Self::PointerTag>>>
+ where
+ 'tcx: 'mir,
+ {
+ ecx.stack_mut()[frame].locals[local].access_mut()
+ }
+
/// Called before a basic block terminator is executed.
/// You can use this to detect endlessly running programs.
#[inline]
_mem: &Memory<'mir, 'tcx, Self>,
_ptr: Pointer<Self::PointerTag>,
) -> InterpResult<'tcx, u64>;
+
+ fn thread_local_alloc_id(
+ _ecx: &mut InterpCx<'mir, 'tcx, Self>,
+ did: DefId,
+ ) -> InterpResult<'tcx, AllocId> {
+ throw_unsup!(ThreadLocalStatic(did))
+ }
}
// A lot of the flexibility above is just needed for `Miri`, but all "compile-time" machines