@@ -145,8 +145,8 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for super::MiriEvalContext<'a, 'mir, '
145
145
// Dead allocations in miri cannot overlap with live allocations, but
146
146
// on read hardware this can easily happen. Thus for comparisons we require
147
147
// both pointers to be live.
148
- self . memory ( ) . get ( left . alloc_id ) ? . check_bounds_ptr ( left) ?;
149
- self . memory ( ) . get ( right . alloc_id ) ? . check_bounds_ptr ( right) ?;
148
+ self . memory ( ) . check_bounds_ptr ( left, InboundsCheck :: Live ) ?;
149
+ self . memory ( ) . check_bounds_ptr ( right, InboundsCheck :: Live ) ?;
150
150
// Two in-bounds pointers, we can compare across allocations
151
151
left == right
152
152
}
@@ -161,12 +161,14 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for super::MiriEvalContext<'a, 'mir, '
161
161
if bits == 0 {
162
162
// Test if the ptr is in-bounds. Then it cannot be NULL.
163
163
// Even dangling pointers cannot be NULL.
164
- if self . memory ( ) . check_bounds_ptr_maybe_dead ( ptr) . is_ok ( ) {
164
+ if self . memory ( ) . check_bounds_ptr ( ptr, InboundsCheck :: MaybeDead ) . is_ok ( ) {
165
165
return Ok ( false ) ;
166
166
}
167
167
}
168
168
169
- let ( alloc_size, alloc_align) = self . memory ( ) . get_size_and_align ( ptr. alloc_id ) ;
169
+ let ( alloc_size, alloc_align) = self . memory ( )
170
+ . get_size_and_align ( ptr. alloc_id , InboundsCheck :: MaybeDead )
171
+ . expect ( "determining size+align of dead ptr cannot fail" ) ;
170
172
171
173
// Case II: Alignment gives it away
172
174
if ptr. offset . bytes ( ) % alloc_align. bytes ( ) == 0 {
0 commit comments