Add message before dumping alloc

This commit is contained in:
David Cook 2020-04-23 20:00:09 -05:00
parent 9057dae235
commit d9ac84d05f

View File

@ -118,7 +118,12 @@ pub fn report_error<'tcx, 'mir>(
let result = report_msg(ecx, &format!("{}: {}", title, msg), msg, helps, true);
if let UndefinedBehavior(UndefinedBehaviorInfo::InvalidUndefBytes(Some(ptr))) = e.kind {
eprintln!(
"Uninitialized read occurred at offset 0x{:x} into this allocation:",
ptr.offset.bytes(),
);
ecx.memory.dump_alloc(ptr.alloc_id);
eprintln!();
}
result