@@ -142,8 +142,8 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for EvalContext<'a, 'mir, 'tcx, super:
142
142
// allocations sit right next to each other. The C/C++ standards are
143
143
// somewhat fuzzy about this case, so I think for now this check is
144
144
// "good enough".
145
- self . memory . check_bounds ( left, false ) ?;
146
- self . memory . check_bounds ( right, false ) ?;
145
+ self . memory . check_bounds_ptr ( left, false ) ?;
146
+ self . memory . check_bounds_ptr ( right, false ) ?;
147
147
// Two live in-bounds pointers, we can compare across allocations
148
148
left == right
149
149
}
@@ -153,7 +153,7 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for EvalContext<'a, 'mir, 'tcx, super:
153
153
( Scalar :: Bits { bits, size } , Scalar :: Ptr ( ptr) ) => {
154
154
assert_eq ! ( size as u64 , self . pointer_size( ) . bytes( ) ) ;
155
155
let bits = bits as u64 ;
156
- let ( alloc_size, alloc_align) = self . memory . get_size_and_align ( ptr. alloc_id ) ? ;
156
+ let ( alloc_size, alloc_align) = self . memory . get_size_and_align ( ptr. alloc_id ) ;
157
157
158
158
// Case I: Comparing with NULL
159
159
if bits == 0 {
@@ -296,9 +296,9 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for EvalContext<'a, 'mir, 'tcx, super:
296
296
if let Scalar :: Ptr ( ptr) = ptr {
297
297
// Both old and new pointer must be in-bounds.
298
298
// (Of the same allocation, but that part is trivial with our representation.)
299
- self . memory . check_bounds ( ptr, false ) ?;
299
+ self . memory . check_bounds_ptr ( ptr, false ) ?;
300
300
let ptr = ptr. signed_offset ( offset, self ) ?;
301
- self . memory . check_bounds ( ptr, false ) ?;
301
+ self . memory . check_bounds_ptr ( ptr, false ) ?;
302
302
Ok ( Scalar :: Ptr ( ptr) )
303
303
} else {
304
304
// An integer pointer. They can move around freely, as long as they do not overflow
0 commit comments