mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-17 01:28:44 +00:00
fix(c-api) Fix how wasm_globaltype_t is implemented.
In `wasm.h`, `wasm_globaltype_t` is implemented with
`WASM_DECLARE_TYPE`, so with `WASM_DECLARE_VEC(globaltype, *)`. This
`*` means the C struct for the vector is defined:
```c
struct wasm_globaltype_vec_t {
size_t size;
wasm_globaltype_t** data;
}
```
The way we implement `wasm_globaltype_vec_t` in Rust is with the
`wasm_declare_vec!` macro. And it is wrong. We must use
`wasm_declared_boxed_vec!`.
This commit is contained in:
@@ -46,7 +46,7 @@ impl wasm_globaltype_t {
|
||||
}
|
||||
}
|
||||
|
||||
wasm_declare_vec!(globaltype);
|
||||
wasm_declare_boxed_vec!(globaltype);
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_globaltype_new(
|
||||
|
||||
Reference in New Issue
Block a user