This commit is contained in:
Able 2021-11-14 20:58:03 -06:00
parent 5ea0f4938b
commit b58a4af6fa
2 changed files with 13 additions and 11 deletions

View file

@ -34,6 +34,7 @@ impl Externals for HostFunctions {
} }
/// Do nothing /// Do nothing
SysCall::EMPTY => Ok(None), SysCall::EMPTY => Ok(None),
SysCall::EXIT => Ok(None),
// SysCall::CONSOLE_RESET => {} // SysCall::CONSOLE_RESET => {}
// SysCall::CONSOLE_IN => {} // SysCall::CONSOLE_IN => {}
// SysCall::CONSOLE_OUT => {} // SysCall::CONSOLE_OUT => {}
@ -48,6 +49,7 @@ impl ModuleImportResolver for HostFunctions {
let index = match field_name { let index = match field_name {
"kill" => SysCall::KILL as usize, "kill" => SysCall::KILL as usize,
"empty" => SysCall::EMPTY as usize, "empty" => SysCall::EMPTY as usize,
"exit" => SysCall::EXIT as usize,
_ => { _ => {
return Err(Error::Instantiation(format!( return Err(Error::Instantiation(format!(
"Export {} not found", "Export {} not found",
@ -74,7 +76,7 @@ fn main() {
// Parse WAT (WebAssembly Text format) into wasm bytecode. // Parse WAT (WebAssembly Text format) into wasm bytecode.
// let wasm_binary = wabt::wat2wasm(include_str!("../wasm/test.wat")); // let wasm_binary = wabt::wat2wasm(include_str!("../wasm/test.wat"));
let wasm_binary = //wabt::wat2wasm( let wasm_binary = //wabt::wat2wasm(
include_bytes!("../wasm/ableos-wasm-test.wasm"); //.unwrap(); include_bytes!("../src/ableos-wasm-test.wasm"); //.unwrap();
// ); // );
/* /*
let wasm_binary = match wasm_binary { let wasm_binary = match wasm_binary {

Binary file not shown.