Create trap for error message when wasm_instance_new fails (#1751)
Create trap for error message when wasm_instance_new fails: - Similar to [this PR](https://github.com/bytecodealliance/wasm-micro-runtime/pull/1526), but create a wasm_trap_t to output the error msg instead of adding error_buf to the API. - Trap will need to be deleted by the caller but is not a breaking change as it is only created if trap is not NULL. - Add error messages for all failure cases here, try to make them accurate but welcome feedback for improvements. Signed-off-by: Andrew Chambers <ncham@amazon.com>
This commit is contained in:
@ -592,13 +592,13 @@ WASM_DECLARE_REF(instance)
|
||||
|
||||
WASM_API_EXTERN own wasm_instance_t* wasm_instance_new(
|
||||
wasm_store_t*, const wasm_module_t*, const wasm_extern_vec_t *imports,
|
||||
own wasm_trap_t**
|
||||
own wasm_trap_t** trap
|
||||
);
|
||||
|
||||
// please refer to wasm_runtime_instantiate(...) in core/iwasm/include/wasm_export.h
|
||||
WASM_API_EXTERN own wasm_instance_t* wasm_instance_new_with_args(
|
||||
wasm_store_t*, const wasm_module_t*, const wasm_extern_vec_t *imports,
|
||||
own wasm_trap_t**, const uint32_t stack_size, const uint32_t heap_size
|
||||
own wasm_trap_t** trap, const uint32_t stack_size, const uint32_t heap_size
|
||||
);
|
||||
|
||||
WASM_API_EXTERN void wasm_instance_exports(const wasm_instance_t*, own wasm_extern_vec_t* out);
|
||||
|
||||
Reference in New Issue
Block a user