Skip to content

Commit

Permalink
fix(c-api) Fix how wasm_tabletype_t is implemented.
Browse files Browse the repository at this point in the history
In `wasm.h`, `wasm_tabletype_t` is implemented with
`WASM_DECLARE_TYPE`, so with `WASM_DECLARE_VEC(tabletype, *)`. This
`*` means the C struct for the vector is defined:

```c
struct wasm_tabletype_vec_t {
    size_t size;
    wasm_tabletype_t** data;
}
```

The way we implement `wasm_tabletype_vec_t` in Rust is with the
`wasm_declare_vec!` macro. And it is wrong. We must use
`wasm_declared_boxed_vec!`.
  • Loading branch information
Hywan committed Dec 17, 2020
1 parent a3c7a2d commit a0c34fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/c-api/src/wasm_c_api/types/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl wasm_tabletype_t {
}
}

wasm_declare_vec!(tabletype);
wasm_declare_boxed_vec!(tabletype);

#[no_mangle]
pub unsafe extern "C" fn wasm_tabletype_new(
Expand Down

0 comments on commit a0c34fe

Please sign in to comment.