Closed
Description
In the following code, test
should explicitly be allowed to unwind:
#![feature(c_unwind)]
extern "C-unwind" {
fn test();
}
fn main() {
unsafe { test(); }
}
However, when building this with -Cpanic=abort
, we generate LLVM IR as follows:
; Function Attrs: nounwind nonlazybind
declare void @test() unnamed_addr #1
This means unwinding of test
is UB, i.e., this is a soundness problem.
This most likely also affects #[unwind(allowed)]
, but that attribute is slated for removal anyway.