commit p2
This commit is contained in:
parent
b58a4af6fa
commit
32d6f1e4fd
24
src/main.rs
24
src/main.rs
|
@ -7,8 +7,6 @@ use wasmi::{
|
||||||
mod wasm_sys;
|
mod wasm_sys;
|
||||||
use wasm_sys::SysCall;
|
use wasm_sys::SysCall;
|
||||||
|
|
||||||
pub const KILL: usize = 0;
|
|
||||||
|
|
||||||
struct HostFunctions;
|
struct HostFunctions;
|
||||||
impl HostFunctions {
|
impl HostFunctions {
|
||||||
fn check_signature(&self, index: usize, signature: &Signature) -> bool {
|
fn check_signature(&self, index: usize, signature: &Signature) -> bool {
|
||||||
|
@ -76,17 +74,17 @@ 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!("../src/ableos-wasm-test.wasm"); //.unwrap();
|
include_bytes!("../wasm/ableos-wasm-test.wasm"); //.unwrap();
|
||||||
// );
|
// );
|
||||||
/*
|
/*
|
||||||
let wasm_binary = match wasm_binary {
|
let wasm_binary = match wasm_binary {
|
||||||
Ok(abc) => abc,
|
Ok(abc) => abc,
|
||||||
Err(abc) => {
|
Err(abc) => {
|
||||||
println!("{}", abc);
|
println!("{}", abc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
// .expect("failed to parse wat");
|
// .expect("failed to parse wat");
|
||||||
|
|
||||||
// Load wasm binary and prepare it for instantiation.
|
// Load wasm binary and prepare it for instantiation.
|
||||||
|
|
BIN
wasm/ableos-wasm-test.wasm
Executable file
BIN
wasm/ableos-wasm-test.wasm
Executable file
Binary file not shown.
Reference in a new issue