Skip to content

Commit

Permalink
tests: use extern "C-unwind" in native host fns to unwind panics
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Sep 14, 2024
1 parent 22e0563 commit 7792418
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions crates/tests/src/vm_host_env/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions crates/tests/src/vm_host_env/vp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 7792418

Please sign in to comment.