Allow calling functions with any signature

This commit is contained in:
Jef
2018-12-12 11:52:48 +01:00
parent b32f77ea02
commit 86353cba5e
3 changed files with 74 additions and 14 deletions

View File

@@ -22,7 +22,7 @@ fn read_to_end<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
fn maybe_main() -> Result<(), String> {
let data = read_to_end("test.wasm").map_err(|e| e.to_string())?;
let translated = translate(&data).map_err(|e| e.to_string())?;
let result = translated.execute_func(0, 5, 3);
let result: u32 = unsafe { translated.execute_func(0, (5u32, 3u32)) };
println!("f(5, 3) = {}", result);
Ok(())