Skip to content

Commit

Permalink
fix(host function): forget result function
Browse files Browse the repository at this point in the history
  • Loading branch information
ActivePeter committed Jun 13, 2024
1 parent 5a804c2 commit 27e08da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/worker/func/wasm_host_funcs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mod result;

use fs::FsFuncsRegister;
use kv::KvFuncsRegister;
use result::ResultFuncsRegister;

use crate::sys::LogicalModulesRef;

Expand Down Expand Up @@ -167,7 +168,7 @@ pub fn new_import_obj() -> ImportObject {
let builder = ImportObjectBuilder::new();
let builder = KvFuncsRegister {}.register(builder);
let builder = FsFuncsRegister {}.register(builder);
let builder = FsFuncsRegister.register(builder);
let builder = ResultFuncsRegister.register(builder);

builder.build::<NeverType>("env", None).unwrap()
}
2 changes: 1 addition & 1 deletion src/worker/func/wasm_host_funcs/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use wasmedge_sdk::{

// fname_ptr, fname_len, fd_ptr
type WriteResultArgs = (i32, i32);
#[cfg_attr(target_os = "linux", host_function)]
#[host_function]
fn write_result(caller: Caller, args: Vec<WasmValue>) -> Result<Vec<WasmValue>, HostFuncError> {
let fname = utils::u8slice(&caller, args[0].to_i32(), args[1].to_i32());
unsafe { utils::current_app_fn_ctx(&caller).0.as_mut() }.res =
Expand Down

0 comments on commit 27e08da

Please sign in to comment.