From 4abf6f81da5e6b053ffa132d0c58b4ed4a8612a5 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Thu, 17 Dec 2020 14:15:28 +0100 Subject: [PATCH] fix(c-api) Fix how `wasm_frame_t` is implemented. In `wasm.h`, `wasm_frame_t` is implemented with `WASM_DECLARE_TYPE`, so with `WASM_DECLARE_VEC(frame, *)`. This `*` means the C struct for the vector is defined: ```c struct wasm_frame_vec_t { size_t size; wasm_frame_t** data; } ``` The way we implement `wasm_frame_vec_t` in Rust is with the `wasm_declare_vec!` macro. And it is wrong. We must use `wasm_declared_boxed_vec!`. --- lib/c-api/src/wasm_c_api/types/frame.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/c-api/src/wasm_c_api/types/frame.rs b/lib/c-api/src/wasm_c_api/types/frame.rs index d926ce977b9..99f3361ab63 100644 --- a/lib/c-api/src/wasm_c_api/types/frame.rs +++ b/lib/c-api/src/wasm_c_api/types/frame.rs @@ -48,4 +48,4 @@ pub unsafe extern "C" fn wasm_frame_module_offset(frame: &wasm_frame_t) -> usize frame.info.module_offset() } -wasm_declare_vec!(frame); +wasm_declare_boxed_vec!(frame);