Auto merge of #1619 - RalfJung:rustup, r=RalfJung

rustup
This commit is contained in:
bors 2020-11-05 16:10:13 +00:00
commit 30e0c303a0
3 changed files with 3 additions and 6 deletions

View File

@ -1 +1 @@
5cdf5b882da9e8b7c73b5cadeb7745cb68f6ff63
89631663b7ad2d46d3e4f52bcfa7bee2be9eb82b

View File

@ -81,10 +81,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
throw_unsup_format!("unknown `miri_resolve_frame` flags {}", flags);
}
let ptr = match this.read_scalar(ptr)?.check_init()? {
Scalar::Ptr(ptr) => ptr,
Scalar::Raw { .. } => throw_ub_format!("expected a pointer in `rust_miri_resolve_frame`, found {:?}", ptr)
};
let ptr = this.force_ptr(this.read_scalar(ptr)?.check_init()?)?;
let fn_instance = if let Some(GlobalAlloc::Function(instance)) = this.tcx.get_global_alloc(ptr.alloc_id) {
instance

View File

@ -4,6 +4,6 @@ extern "Rust" {
fn main() {
unsafe {
miri_resolve_frame(0 as *mut _, 0); //~ ERROR Undefined Behavior: expected a pointer
miri_resolve_frame(0 as *mut _, 0); //~ ERROR 0x0 is not a valid pointer
}
}