@@ -158,8 +158,8 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for super::MiriEvalContext<'a, 'mir, '
158
158
// Dead allocations in miri cannot overlap with live allocations, but
159
159
// on read hardware this can easily happen. Thus for comparisons we require
160
160
// both pointers to be live.
161
- self . memory ( ) . check_bounds_ptr ( left, InboundsCheck :: Live ) ?;
162
- self . memory ( ) . check_bounds_ptr ( right, InboundsCheck :: Live ) ?;
161
+ self . memory ( ) . check_bounds_ptr ( left, InboundsCheck :: Live , CheckInAllocMsg :: InboundsTest ) ?;
162
+ self . memory ( ) . check_bounds_ptr ( right, InboundsCheck :: Live , CheckInAllocMsg :: InboundsTest ) ?;
163
163
// Two in-bounds pointers, we can compare across allocations.
164
164
left == right
165
165
}
@@ -183,7 +183,7 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for super::MiriEvalContext<'a, 'mir, '
183
183
if bits < 32 {
184
184
// Test if the ptr is in-bounds. Then it cannot be NULL.
185
185
// Even dangling pointers cannot be NULL.
186
- if self . memory ( ) . check_bounds_ptr ( ptr, InboundsCheck :: MaybeDead ) . is_ok ( ) {
186
+ if self . memory ( ) . check_bounds_ptr ( ptr, InboundsCheck :: MaybeDead , CheckInAllocMsg :: NullPointerTest ) . is_ok ( ) {
187
187
return Ok ( false ) ;
188
188
}
189
189
}
@@ -340,9 +340,9 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for super::MiriEvalContext<'a, 'mir, '
340
340
if let Scalar :: Ptr ( ptr) = ptr {
341
341
// Both old and new pointer must be in-bounds of a *live* allocation.
342
342
// (Of the same allocation, but that part is trivial with our representation.)
343
- self . memory ( ) . check_bounds_ptr ( ptr, InboundsCheck :: Live ) ?;
343
+ self . memory ( ) . check_bounds_ptr ( ptr, InboundsCheck :: Live , CheckInAllocMsg :: InboundsTest ) ?;
344
344
let ptr = ptr. signed_offset ( offset, self ) ?;
345
- self . memory ( ) . check_bounds_ptr ( ptr, InboundsCheck :: Live ) ?;
345
+ self . memory ( ) . check_bounds_ptr ( ptr, InboundsCheck :: Live , CheckInAllocMsg :: InboundsTest ) ?;
346
346
Ok ( Scalar :: Ptr ( ptr) )
347
347
} else {
348
348
// An integer pointer. They can only be offset by 0, and we pretend there
0 commit comments