From 77924183e6a4ba64338af57d8b6b3861aa33e4df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Zemanovi=C4=8D?= Date: Sat, 14 Sep 2024 16:19:51 +0200 Subject: [PATCH] tests: use `extern "C-unwind"` in native host fns to unwind panics --- crates/tests/src/vm_host_env/tx.rs | 6 +++--- crates/tests/src/vm_host_env/vp.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/tests/src/vm_host_env/tx.rs b/crates/tests/src/vm_host_env/tx.rs index aeb399c8d3..5e39ead354 100644 --- a/crates/tests/src/vm_host_env/tx.rs +++ b/crates/tests/src/vm_host_env/tx.rs @@ -339,7 +339,7 @@ mod native_tx_host_env { ( $fn:ident ( $($arg:ident : $type:ty),* $(,)?) ) => { concat_idents!(extern_fn_name = namada, _, $fn { #[no_mangle] - extern "C" fn extern_fn_name( $($arg: $type),* ) { + extern "C-unwind" fn extern_fn_name( $($arg: $type),* ) { with(|TestTxEnv { state, iterators, @@ -384,7 +384,7 @@ mod native_tx_host_env { ( $fn:ident ( $($arg:ident : $type:ty),* $(,)?) -> $ret:ty ) => { concat_idents!(extern_fn_name = namada, _, $fn { #[no_mangle] - extern "C" fn extern_fn_name( $($arg: $type),* ) -> $ret { + extern "C-unwind" fn extern_fn_name( $($arg: $type),* ) -> $ret { with(|TestTxEnv { tx_index, state, @@ -429,7 +429,7 @@ mod native_tx_host_env { ( "non-result", $fn:ident ( $($arg:ident : $type:ty),* $(,)?) ) => { concat_idents!(extern_fn_name = namada, _, $fn { #[no_mangle] - extern "C" fn extern_fn_name( $($arg: $type),* ) { + extern "C-unwind" fn extern_fn_name( $($arg: $type),* ) { with(|TestTxEnv { state, iterators, diff --git a/crates/tests/src/vm_host_env/vp.rs b/crates/tests/src/vm_host_env/vp.rs index 5fa7d04461..8b88009376 100644 --- a/crates/tests/src/vm_host_env/vp.rs +++ b/crates/tests/src/vm_host_env/vp.rs @@ -226,7 +226,7 @@ mod native_vp_host_env { ( $fn:ident ( $($arg:ident : $type:ty),* $(,)?) ) => { concat_idents!(extern_fn_name = namada, _, $fn { #[no_mangle] - extern "C" fn extern_fn_name( $($arg: $type),* ) { + extern "C-unwind" fn extern_fn_name( $($arg: $type),* ) { with(|TestVpEnv { addr, state, @@ -271,7 +271,7 @@ mod native_vp_host_env { ( $fn:ident ( $($arg:ident : $type:ty),* $(,)?) -> $ret:ty ) => { concat_idents!(extern_fn_name = namada, _, $fn { #[no_mangle] - extern "C" fn extern_fn_name( $($arg: $type),* ) -> $ret { + extern "C-unwind" fn extern_fn_name( $($arg: $type),* ) -> $ret { with(|TestVpEnv { addr, state,