Update WebAssembly C API submodule to latest commit. (#2579)
* Update WebAssembly C API submodule to latest commit. This commit updates the WebAssembly C API submodule (for `wasm.h`) to the latest commit out of master. This fixes the behavior of `wasm_name_new_from_string` such that it no longer copies the null character into the name, which caused unexpected failures when using the Wasmtime linker as imports wouldn't resolve when the null was present. Along with this change were breaking changes to `wasm_func_call`, the host callback signatures, and `wasm_instance_new` to take a vector type instead of a pointer to an unsized array. As a result, Wasmtime language bindings based on the C API will need to be updated once this change is pulled in. Fixes #2211. Fixes #2131. * Update Doxygen comments for wasm.h changes.
This commit is contained in:
@@ -71,7 +71,8 @@ int main(int argc, const char* argv[]) {
|
||||
printf("Instantiating module...\n");
|
||||
wasm_instance_t* instance = NULL;
|
||||
wasm_trap_t *trap = NULL;
|
||||
error = wasmtime_instance_new(store, module, NULL, 0, &instance, &trap);
|
||||
wasm_extern_vec_t imports = WASM_EMPTY_VEC;
|
||||
error = wasmtime_instance_new(store, module, &imports, &instance, &trap);
|
||||
if (error != NULL || trap != NULL)
|
||||
exit_with_error("failed to instantiate", error, trap);
|
||||
wasm_module_delete(module);
|
||||
@@ -95,9 +96,11 @@ int main(int argc, const char* argv[]) {
|
||||
|
||||
// Call.
|
||||
printf("Calling fib...\n");
|
||||
wasm_val_t params[1] = { {.kind = WASM_I32, .of = {.i32 = 6}} };
|
||||
wasm_val_t params[1] = { WASM_I32_VAL(6) };
|
||||
wasm_val_t results[1];
|
||||
error = wasmtime_func_call(run_func, params, 1, results, 1, &trap);
|
||||
wasm_val_vec_t params_vec = WASM_ARRAY_VEC(params);
|
||||
wasm_val_vec_t results_vec = WASM_ARRAY_VEC(results);
|
||||
error = wasmtime_func_call(run_func, ¶ms_vec, &results_vec, &trap);
|
||||
if (error != NULL || trap != NULL)
|
||||
exit_with_error("failed to call function", error, trap);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user