Skip to content

Commit ecd04fd

Browse files
committed
Add test for unwinding past terminating POF
1 parent 37f7d32 commit ecd04fd

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# ignore-cross-compile
2+
# only-linux
3+
include ../tools.mk
4+
5+
all: foo
6+
$(call RUN,foo) | $(CGREP) -v "cannot unwind"
7+
8+
foo: foo.rs
9+
$(RUSTC) $<
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Tests that forced unwind through POF Rust frames wouldn't trigger our terminating guards.
2+
3+
#![feature(c_unwind)]
4+
#![no_main]
5+
6+
extern "C-unwind" {
7+
fn pthread_exit(v: *mut core::ffi::c_void) -> !;
8+
}
9+
10+
unsafe extern "C" fn call_pthread_exit() {
11+
pthread_exit(core::ptr::null_mut());
12+
}
13+
14+
#[no_mangle]
15+
unsafe extern "C-unwind" fn main(_argc: core::ffi::c_int, _argv: *mut *mut core::ffi::c_char) {
16+
call_pthread_exit();
17+
}

0 commit comments

Comments
 (0)