File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -82,9 +82,12 @@ impl<'mir, 'tcx> GlobalStateInner {
8282 let ( glb, alloc_id) = global_state. int_to_ptr_map [ pos - 1 ] ;
8383 // This never overflows because `addr >= glb`
8484 let offset = addr - glb;
85- // If the offset exceeds the size of the allocation, don't use this `alloc_id`.
85+ // We require this to be strict in-bounds of the allocation. This arm is only
86+ // entered for addresses that are not the base address, so even zero-sized
87+ // allocations will get recognized at their base address -- but all other
88+ // allocations will *not* be recognized at their "end" address.
8689 let size = ecx. get_alloc_info ( alloc_id) . 0 ;
87- if offset <= size. bytes ( ) { Some ( alloc_id) } else { None }
90+ if offset < size. bytes ( ) { Some ( alloc_id) } else { None }
8891 }
8992 } ?;
9093
You can’t perform that action at this time.
0 commit comments