tracked_alloc_id: Option<AllocId>,
/// Controls whether alignment of memory accesses is being checked.
- check_alignment: bool,
+ pub(crate) check_alignment: AlignmentCheck,
}
impl MemoryExtra {
tracked_pointer_tag: Option<PtrId>,
tracked_call_id: Option<CallId>,
tracked_alloc_id: Option<AllocId>,
- check_alignment: bool,
+ check_alignment: AlignmentCheck,
) -> Self {
let stacked_borrows = if stacked_borrows {
Some(Rc::new(RefCell::new(stacked_borrows::GlobalState::new(tracked_pointer_tag, tracked_call_id))))
pub fn init_extern_statics<'tcx, 'mir>(
this: &mut MiriEvalContext<'mir, 'tcx>,
) -> InterpResult<'tcx> {
- match this.tcx.sess.target.target.target_os.as_str() {
+ match this.tcx.sess.target.target_os.as_str() {
"linux" => {
// "__cxa_thread_atexit_impl"
// This should be all-zero, pointer-sized.
pub(crate) argv: Option<Scalar<Tag>>,
pub(crate) cmd_line: Option<Scalar<Tag>>,
- /// Last OS error location in memory. It is a 32-bit integer.
- pub(crate) last_error: Option<MPlaceTy<'tcx, Tag>>,
-
/// TLS state.
pub(crate) tls: TlsData<'tcx>,
/// Whether to enforce the validity invariant.
pub(crate) validate: bool,
- pub(crate) file_handler: shims::posix::FileHandler<'tcx>,
+ pub(crate) file_handler: shims::posix::FileHandler,
pub(crate) dir_handler: shims::posix::DirHandler,
- /// The temporary used for storing the argument of
- /// the call to `miri_start_panic` (the panic payload) when unwinding.
- /// This is pointer-sized, and matches the `Payload` type in `src/libpanic_unwind/miri.rs`.
- pub(crate) panic_payload: Option<Scalar<Tag>>,
-
/// The "time anchor" for this machine's monotone clock (for `Instant` simulation).
pub(crate) time_anchor: Instant,
argc: None,
argv: None,
cmd_line: None,
- last_error: None,
tls: TlsData::default(),
communicate,
validate,
file_handler: Default::default(),
dir_handler: Default::default(),
- panic_payload: None,
time_anchor: Instant::now(),
layouts,
threads: ThreadManager::default(),
#[inline(always)]
fn enforce_alignment(memory_extra: &MemoryExtra) -> bool {
- memory_extra.check_alignment
+ memory_extra.check_alignment != AlignmentCheck::None
+ }
+
+ #[inline(always)]
+ fn force_int_for_alignment_check(memory_extra: &Self::MemoryExtra) -> bool {
+ memory_extra.check_alignment == AlignmentCheck::Int
}
#[inline(always)]