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 {
82
82
let ( glb, alloc_id) = global_state. int_to_ptr_map [ pos - 1 ] ;
83
83
// This never overflows because `addr >= glb`
84
84
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.
86
89
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 }
88
91
}
89
92
} ?;
90
93
You can’t perform that action at this time.
0 commit comments