diff --git a/src/v/wasm/wasmtime.cc b/src/v/wasm/wasmtime.cc index 0e58b209a30ac..9736ab9c45ebd 100644 --- a/src/v/wasm/wasmtime.cc +++ b/src/v/wasm/wasmtime.cc @@ -895,37 +895,6 @@ struct host_function { handle functype{ wasm_functype_new(&inputs, &outputs)}; - if (ssc.enabled()) { - if constexpr (ss::is_future::value) { - handle error( - wasmtime_linker_define_async_func( - linker, - Module::name.data(), - Module::name.size(), - function_name.data(), - function_name.size(), - functype.get(), - &invoke_async_host_fn_with_strict_stack_checking, - /*data=*/ssc.allocator, - /*finalizer=*/nullptr)); - check_error(error.get()); - } else { - handle error( - wasmtime_linker_define_func( - linker, - Module::name.data(), - Module::name.size(), - function_name.data(), - function_name.size(), - functype.get(), - &invoke_sync_host_fn_with_strict_stack_checking, - /*data=*/ssc.allocator, - /*finalizer=*/nullptr)); - check_error(error.get()); - } - return; - } - if constexpr (ss::is_future::value) { handle error( wasmtime_linker_define_async_func( @@ -935,8 +904,9 @@ struct host_function { function_name.data(), function_name.size(), functype.get(), - &invoke_async_host_fn, - /*data=*/nullptr, + ssc.enabled() ? &invoke_async_host_fn_with_strict_stack_checking + : &invoke_async_host_fn, + /*data=*/ssc.allocator, /*finalizer=*/nullptr)); check_error(error.get()); } else { @@ -948,8 +918,9 @@ struct host_function { function_name.data(), function_name.size(), functype.get(), - &invoke_sync_host_fn, - /*data=*/nullptr, + ssc.enabled() ? &invoke_sync_host_fn_with_strict_stack_checking + : &invoke_sync_host_fn, + /*data=*/ssc.allocator, /*finalizer=*/nullptr)); check_error(error.get()); }