Skip to content

Commit d9ac84d

Browse files
committed
Add message before dumping alloc
1 parent 9057dae commit d9ac84d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/diagnostics.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ pub fn report_error<'tcx, 'mir>(
118118
let result = report_msg(ecx, &format!("{}: {}", title, msg), msg, helps, true);
119119

120120
if let UndefinedBehavior(UndefinedBehaviorInfo::InvalidUndefBytes(Some(ptr))) = e.kind {
121+
eprintln!(
122+
"Uninitialized read occurred at offset 0x{:x} into this allocation:",
123+
ptr.offset.bytes(),
124+
);
121125
ecx.memory.dump_alloc(ptr.alloc_id);
126+
eprintln!();
122127
}
123128

124129
result

0 commit comments

Comments
 (0)