From 1b68135b68e9b54ec6b742cbf91509ce658a8a1a Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Tue, 12 Jul 2022 18:38:44 -0700 Subject: [PATCH] wasm-rt-impl.c: statically allocate g_active_exception --- wasm2c/wasm-rt-impl.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/wasm2c/wasm-rt-impl.c b/wasm2c/wasm-rt-impl.c index 22c87d27c..96b3b3953 100644 --- a/wasm2c/wasm-rt-impl.c +++ b/wasm2c/wasm-rt-impl.c @@ -60,7 +60,7 @@ static uint32_t g_func_type_count; jmp_buf wasm_rt_jmp_buf; static uint32_t g_active_exception_tag; -static void* g_active_exception; +static uint8_t g_active_exception[MAX_EXCEPTION_SIZE]; static uint32_t g_active_exception_size; static jmp_buf* g_unwind_target; @@ -230,12 +230,6 @@ static void os_print_last_error(const char* msg) { #endif void wasm_rt_init(void) { - g_active_exception = malloc(MAX_EXCEPTION_SIZE); - if (g_active_exception == NULL) { - perror("malloc failed"); - abort(); - } - #if WASM_RT_MEMCHECK_SIGNAL_HANDLER_POSIX if (!g_signal_handler_installed) { g_signal_handler_installed = true;