Skip to content

Commit e37d0e3

Browse files
committed
Print hex dump of alloc on reading undef bytes
1 parent 8d9db57 commit e37d0e3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/diagnostics.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ pub fn report_error<'tcx, 'mir>(
114114
};
115115

116116
e.print_backtrace();
117+
if let UndefinedBehavior(UndefinedBehaviorInfo::InvalidUndefBytes(Some(ptr))) = e.kind {
118+
ecx.memory.dump_alloc(ptr.alloc_id);
119+
}
117120
let msg = e.to_string();
118121
report_msg(ecx, &format!("{}: {}", title, msg), msg, helps, true)
119122
}

0 commit comments

Comments
 (0)