Permit unwinding through FFI by default

See #58794 for context.
This commit is contained in:
Mark Rousskov 2019-02-27 17:21:31 -07:00 committed by Josh Stone
parent d760df5aea
commit 39412ca969
2 changed files with 3 additions and 1 deletions

View File

@ -502,7 +502,7 @@ fn should_abort_on_panic(tcx: TyCtxt<'_>, fn_def_id: DefId, abi: Abi) -> bool {
// This is a special case: some functions have a C abi but are meant to
// unwind anyway. Don't stop them.
match unwind_attr {
None => true,
None => false, // FIXME(#58794)
Some(UnwindAttr::Allowed) => false,
Some(UnwindAttr::Aborts) => true,
}

View File

@ -1,6 +1,7 @@
// run-pass
#![allow(unused_must_use)]
#![feature(unwind_attributes)]
// Since we mark some ABIs as "nounwind" to LLVM, we must make sure that
// we never unwind through them.
@ -13,6 +14,7 @@ use std::io::prelude::*;
use std::io;
use std::process::{Command, Stdio};
#[unwind(aborts)] // FIXME(#58794)
extern "C" fn panic_in_ffi() {
panic!("Test");
}