From 25d63ab7ab1c8bb555f803f572b9acf6f746c47f Mon Sep 17 00:00:00 2001 From: WillLillis Date: Sun, 24 Aug 2025 04:02:42 -0400 Subject: [PATCH] fix(wasm): delete `var_i32_type` after initializing global stack pointer value (cherry picked from commit 0d914c860a6df48cd8f6f3fa81194e2aabd2beac) --- lib/src/wasm_store.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/src/wasm_store.c b/lib/src/wasm_store.c index d018a68c..f0c0970d 100644 --- a/lib/src/wasm_store.c +++ b/lib/src/wasm_store.c @@ -754,6 +754,7 @@ TSWasmStore *ts_wasm_store_new(TSWasmEngine *engine, TSWasmError *wasm_error) { wasmtime_val_t stack_pointer_value = WASM_I32_VAL(0); wasmtime_global_t stack_pointer_global; error = wasmtime_global_new(context, var_i32_type, &stack_pointer_value, &stack_pointer_global); + wasm_globaltype_delete(var_i32_type); ts_assert(!error); *self = (TSWasmStore) {