Skip to content

Commit 59f63f2

Browse files
committed
whitelist platforms where panicking should work
1 parent 0ff05c4 commit 59f63f2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/shims/panic.rs

+6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
4343

4444
trace!("miri_start_panic: {:?}", this.frame().span);
4545

46+
// Make sure panicking actually works on this platform.
47+
match this.tcx.sess.target.target.target_os.as_str() {
48+
"linux" | "macos" => {},
49+
_ => throw_unsup_format!("panicking is not supported on this platform"),
50+
}
51+
4652
// Get the raw pointer stored in arg[0] (the panic payload).
4753
let payload = this.read_scalar(args[0])?.not_undef()?;
4854
assert!(

0 commit comments

Comments
 (0)