Allow empty import array for wasm-c-api wasm_instance_new (#782)

Allow empty import array (but not NULL) for wasm-c-api wasm_instance_new,
which makes the code more robust, especially in use cases where imports
might be constructed dynamically.
And add a test case in samples/wasm-c-api/src/empty_imports.c to test it.
This commit is contained in:
Michael Martin
2021-10-12 19:06:38 +11:00
committed by GitHub
parent 8edca21df2
commit c94e752532
4 changed files with 107 additions and 1 deletions

View File

@ -0,0 +1,5 @@
(module
(func (export "add") (param i32 i32) (result i32)
(i32.add (local.get 0) (local.get 1))
)
)