From 3fea07dc8a290a8cca42d056283e32d0283f10e6 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Mon, 11 Mar 2019 14:35:51 +0100 Subject: [PATCH] fix(runtime-c-api) Fix the `imports` length. `imports` contains `func_import`, `global_import`, `memory_import` and `table_import`, so 4 items. This patch updates the length of `imports` when calling the `wasmer_instantiate` function. --- lib/runtime-c-api/tests/test-imports.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/runtime-c-api/tests/test-imports.c b/lib/runtime-c-api/tests/test-imports.c index cecb9ec94a7..9c0c45467c2 100644 --- a/lib/runtime-c-api/tests/test-imports.c +++ b/lib/runtime-c-api/tests/test-imports.c @@ -127,7 +127,7 @@ int main() // Creates a WebAssembly Instance from wasm bytes and imports wasmer_instance_t *instance = NULL; - wasmer_result_t compile_result = wasmer_instantiate(&instance, bytes, len, imports, 3); + wasmer_result_t compile_result = wasmer_instantiate(&instance, bytes, len, imports, 4); printf("Compile result: %d\n", compile_result); if (compile_result != WASMER_OK) {