From 954e5e849518204aa814eecd555ab4935b9ecf50 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 13 Oct 2020 10:26:32 +0200 Subject: [PATCH 1/2] fix(c-api) Register errors from `wasm_module_serialize`. --- lib/c-api/src/wasm_c_api/module.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(); } From 0dc74bf922a74a77172db027cb51a137805af182 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 13 Oct 2020 10:29:52 +0200 Subject: [PATCH 2/2] doc(changelog) Add #1715. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74d19d04d77..ce267692004 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. - [#1700](https://github.com/wasmerio/wasmer/pull/1700) Implement `wasm_externtype_copy` in the Wasm C API. ## 1.0.0-alpha4 - 2020-10-08