MaybeDead,
}
-/// Used by `check_in_alloc` to indicate whether the pointer needs to be just inbounds
-/// or also inbounds of a *live* allocation.
+/// Used by `check_in_alloc` to indicate context of check
#[derive(Debug, Copy, Clone, RustcEncodable, RustcDecodable, HashStable)]
pub enum CheckInAllocMsg {
ReadCStr,
use super::{
Pointer, AllocId, Allocation, GlobalId, AllocationExtra,
EvalResult, Scalar, EvalErrorKind, AllocKind, PointerArithmetic,
- Machine, AllocMap, MayLeak, ErrorHandled, InboundsCheck, CheckInAllocMsg,
+ Machine, AllocMap, MayLeak, ErrorHandled, CheckInAllocMsg,
};
#[derive(Debug, PartialEq, Eq, Copy, Clone, Hash)]
Ok((layout.size, layout.align.abi))
}
_ => match msg {
- InboundsCheck::MaybeDead => {
+ CheckInAllocMsg::CheckAlign | CheckInAllocMsg::ReadDiscriminant => {
// Must be a deallocated pointer
Ok(*self.dead_alloc_map.get(&id).expect(
"allocation missing in dead_alloc_map"
))
},
- InboundsCheck::Live => err!(DanglingPointerDeref),
+ _ => err!(DanglingPointerDeref),
},
}
}