diff --git a/rust-version b/rust-version index efb6b94d3b4..514517267a0 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -5cdf5b882da9e8b7c73b5cadeb7745cb68f6ff63 +89631663b7ad2d46d3e4f52bcfa7bee2be9eb82b diff --git a/src/shims/backtrace.rs b/src/shims/backtrace.rs index 8cf7ac20752..a599ee70efa 100644 --- a/src/shims/backtrace.rs +++ b/src/shims/backtrace.rs @@ -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 diff --git a/tests/compile-fail/backtrace/bad-backtrace-ptr.rs b/tests/compile-fail/backtrace/bad-backtrace-ptr.rs index 5e245952e9b..0c49a527bc1 100644 --- a/tests/compile-fail/backtrace/bad-backtrace-ptr.rs +++ b/tests/compile-fail/backtrace/bad-backtrace-ptr.rs @@ -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 } }