mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 13:40:15 +03:00
Pointers must be valid, even pointers to zsts
This commit is contained in:
+11
-1
@@ -145,7 +145,7 @@ fn run_main<'a, 'mir: 'a, 'tcx: 'mir>(
|
||||
main_instance,
|
||||
main_mir.span,
|
||||
main_mir,
|
||||
Place::undef(),
|
||||
Place::from_primval_ptr(PrimVal::Bytes(1).into(), ty::layout::Align::from_bytes(1, 1).unwrap()),
|
||||
StackPopCleanup::None,
|
||||
)?;
|
||||
|
||||
@@ -177,6 +177,16 @@ fn run_main<'a, 'mir: 'a, 'tcx: 'mir>(
|
||||
Err(mut e) => {
|
||||
ecx.tcx.sess.err(&e.to_string());
|
||||
ecx.report(&mut e, true, None);
|
||||
for (i, frame) in ecx.stack().iter().enumerate() {
|
||||
trace!("-------------------");
|
||||
trace!("Frame {}", i);
|
||||
trace!(" return: {:#?}", frame.return_place);
|
||||
for (i, local) in frame.locals.iter().enumerate() {
|
||||
if let Some(local) = local {
|
||||
trace!(" local {}: {:?}", i, local);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user