Skip to content

Commit

Permalink
Fix wasm_importtype_new's Rust signature to not assume boxed vectors
Browse files Browse the repository at this point in the history
Fixes #2718
  • Loading branch information
Amanieu committed Dec 13, 2021
1 parent a5fd71b commit 4dfe84c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/c-api/src/wasm_c_api/types/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ wasm_declare_boxed_vec!(importtype);

#[no_mangle]
pub extern "C" fn wasm_importtype_new(
module: Option<Box<wasm_name_t>>,
name: Option<Box<wasm_name_t>>,
module: Option<&mut wasm_name_t>,
name: Option<&mut wasm_name_t>,
extern_type: Option<Box<wasm_externtype_t>>,
) -> Option<Box<wasm_importtype_t>> {
Some(Box::new(wasm_importtype_t {
name: *name?,
module: *module?,
name: name?.take().into(),
module: module?.take().into(),
extern_type: *extern_type?,
}))
}
Expand Down

0 comments on commit 4dfe84c

Please sign in to comment.