From d9ac84d05fc58aa82b4c4306f42231bb6aeb9226 Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 23 Apr 2020 20:00:09 -0500 Subject: [PATCH] Add message before dumping alloc --- src/diagnostics.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/diagnostics.rs b/src/diagnostics.rs index 565db7b178a..e72232323ba 100644 --- a/src/diagnostics.rs +++ b/src/diagnostics.rs @@ -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 -- 2.44.0