Change wasm_module_new to use Module::from_binary.
This commit changes the C API function `wasm_module_new` to use the Rust API `Module::from_binary` which performs verification of the module, as per the C API spec. This also introduces a `EngineBuilder` type to the C# API that can be used to construct an `Engine` with the various Wasmtime configuration options. This is required to get the C# tests passing since they use reference types and multi-value. Fixes #859.
This commit is contained in:
@@ -831,7 +831,7 @@ pub unsafe extern "C" fn wasm_module_new(
|
||||
) -> *mut wasm_module_t {
|
||||
let binary = (*binary).as_slice();
|
||||
let store = &(*store).store.borrow();
|
||||
let module = match Module::from_binary_unchecked(store, binary) {
|
||||
let module = match Module::from_binary(store, binary) {
|
||||
Ok(module) => module,
|
||||
Err(_) => return ptr::null_mut(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user