check Allocation invariant during printing

This commit is contained in:
Ralf Jung 2022-04-17 21:08:58 -04:00
parent 29cc8ec2d1
commit 05489e7ec8

View File

@ -851,6 +851,7 @@ fn write_allocation_bytes<'tcx, Tag: Provenance, Extra>(
}
if let Some(&tag) = alloc.relocations().get(&i) {
// Memory with a relocation must be defined
assert!(alloc.init_mask().is_range_initialized(i, i + ptr_size).is_ok());
let j = i.bytes_usize();
let offset = alloc
.inspect_with_uninit_and_ptr_outside_interpreter(j..j + ptr_size.bytes_usize());