Skip to content

Commit a2f9955

Browse files
committed
Use C-unwind
1 parent 9870059 commit a2f9955

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/ark/src/debug.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static _ARK_DISPLAY_VALUE: unsafe extern "C" fn(x: libr::SEXP) -> *const ffi::c_
3434
// Implementations for entry points in `debug.c`.
3535

3636
#[no_mangle]
37-
pub extern "C" fn ark_print_rs(x: libr::SEXP) -> *const ffi::c_char {
37+
pub extern "C-unwind" fn ark_print_rs(x: libr::SEXP) -> *const ffi::c_char {
3838
capture_console_output(|| {
3939
unsafe { libr::Rf_PrintValue(x) };
4040
})
@@ -53,7 +53,7 @@ pub extern "C" fn ark_print_rs(x: libr::SEXP) -> *const ffi::c_char {
5353
/// settings set escape-non-printables false
5454
/// ```
5555
#[no_mangle]
56-
pub extern "C" fn ark_inspect_rs(x: libr::SEXP) -> *const ffi::c_char {
56+
pub extern "C-unwind" fn ark_inspect_rs(x: libr::SEXP) -> *const ffi::c_char {
5757
capture_console_output(|| {
5858
// TODO: Should use C callable when implemented as that would avoid
5959
// messing with namedness and refcounts:
@@ -71,7 +71,7 @@ pub extern "C" fn ark_inspect_rs(x: libr::SEXP) -> *const ffi::c_char {
7171
/// settings set escape-non-printables false
7272
/// ```
7373
#[no_mangle]
74-
pub extern "C" fn ark_trace_back_rs() -> *const ffi::c_char {
74+
pub extern "C-unwind" fn ark_trace_back_rs() -> *const ffi::c_char {
7575
capture_console_output(|| {
7676
// https://github.com/r-lib/rlang/issues/1059
7777
unsafe {
@@ -83,7 +83,7 @@ pub extern "C" fn ark_trace_back_rs() -> *const ffi::c_char {
8383
}
8484

8585
#[no_mangle]
86-
pub extern "C" fn ark_display_value_rs(x: libr::SEXP) -> *const ffi::c_char {
86+
pub extern "C-unwind" fn ark_display_value_rs(x: libr::SEXP) -> *const ffi::c_char {
8787
let value = unsafe {
8888
let kind = tidy_kind(r_typeof(x));
8989
let tag = format!("<{kind}>");

0 commit comments

Comments
 (0)