Skip to content

Commit 05489e7

Browse files
committed
check Allocation invariant during printing
1 parent 29cc8ec commit 05489e7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/rustc_middle/src/mir/pretty.rs

+1
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,7 @@ fn write_allocation_bytes<'tcx, Tag: Provenance, Extra>(
851851
}
852852
if let Some(&tag) = alloc.relocations().get(&i) {
853853
// Memory with a relocation must be defined
854+
assert!(alloc.init_mask().is_range_initialized(i, i + ptr_size).is_ok());
854855
let j = i.bytes_usize();
855856
let offset = alloc
856857
.inspect_with_uninit_and_ptr_outside_interpreter(j..j + ptr_size.bytes_usize());

0 commit comments

Comments
 (0)