Skip to content

Commit a20944f

Browse files
committed
Address wasm_rt_impl_try UB
1 parent 46648b0 commit a20944f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

wasm2c/wasm-rt-impl.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ extern WASM_RT_THREAD_LOCAL uint32_t wasm_rt_saved_call_stack_depth;
5757
* my_wasm_func();
5858
* ```
5959
*/
60-
#define wasm_rt_impl_try() \
61-
(WASM_RT_SAVE_STACK_DEPTH(), wasm_rt_set_unwind_target(&g_wasm_rt_jmp_buf), \
62-
WASM_RT_SETJMP(g_wasm_rt_jmp_buf))
60+
#define wasm_rt_impl_try() \
61+
WASM_RT_SETJMP((WASM_RT_SAVE_STACK_DEPTH(), \
62+
wasm_rt_set_unwind_target(&g_wasm_rt_jmp_buf), \
63+
g_wasm_rt_jmp_buf))
6364

6465
#ifdef __cplusplus
6566
}

0 commit comments

Comments
 (0)