diff options
| author | Ralf Jung <post@ralfj.de> | 2022-04-17 21:08:58 -0400 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-04-17 21:08:58 -0400 |
| commit | 05489e7ec8ee4cdf83b819dac3de83ef6515c98a (patch) | |
| tree | 1c93cf2d2e7009c9126cc90df527cfa30fac6a83 | |
| parent | 29cc8ec2d1b959190c9664b1071add7ae327c59c (diff) | |
| download | rust-05489e7ec8ee4cdf83b819dac3de83ef6515c98a.tar.gz rust-05489e7ec8ee4cdf83b819dac3de83ef6515c98a.zip | |
check Allocation invariant during printing
| -rw-r--r-- | compiler/rustc_middle/src/mir/pretty.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/mir/pretty.rs b/compiler/rustc_middle/src/mir/pretty.rs index 69dac038839..b7f695da544 100644 --- a/compiler/rustc_middle/src/mir/pretty.rs +++ b/compiler/rustc_middle/src/mir/pretty.rs @@ -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()); |
