- // We require liveness, as dead allocations can of course overlap.
- self.memory().check_bounds_ptr(left, InboundsCheck::Live)?;
- self.memory().check_bounds_ptr(right, InboundsCheck::Live)?;
- // Two live in-bounds pointers, we can compare across allocations
+ // Dead allocations in miri cannot overlap with live allocations, but
+ // on read hardware this can easily happen. Thus for comparisons we require
+ // both pointers to be live.
+ self.memory().get(left.alloc_id)?.check_bounds_ptr(left)?;
+ self.memory().get(right.alloc_id)?.check_bounds_ptr(right)?;
+ // Two in-bounds pointers, we can compare across allocations