diff --git a/CHANGELOG.md b/CHANGELOG.md index edba3e67454..1130551aa2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Added +- [#1715](https://github.com/wasmerio/wasmer/pull/1715) Register errors from `wasm_module_serialize` in the Wasm C API. - [#1709](https://github.com/wasmerio/wasmer/pull/1709) Implement `wasm_module_name` and `wasm_module_set_name` in the Wasm(er) C API. - [#1700](https://github.com/wasmerio/wasmer/pull/1700) Implement `wasm_externtype_copy` in the Wasm C API. diff --git a/lib/c-api/src/wasm_c_api/module.rs b/lib/c-api/src/wasm_c_api/module.rs index 6e334097b04..dca2d6e3fde 100644 --- a/lib/c-api/src/wasm_c_api/module.rs +++ b/lib/c-api/src/wasm_c_api/module.rs @@ -108,7 +108,10 @@ pub unsafe extern "C" fn wasm_module_serialize( ) { let byte_vec = match module.inner.serialize() { Ok(byte_vec) => byte_vec, - Err(_) => return, + Err(err) => { + crate::error::update_last_error(err); + return; + } }; *out_ptr = byte_vec.into(); }