wasm_interp: Handle calls to imports

This commit is contained in:
Brian Carroll 2022-12-01 20:41:38 +00:00
parent b10ac827f1
commit c866ce6b09
No known key found for this signature in database
GPG key ID: 5C7B2EC4101703C0
6 changed files with 103 additions and 34 deletions

View file

@ -6,7 +6,7 @@ use std::fs;
use std::io;
use std::process;
use roc_wasm_interp::Instance;
use roc_wasm_interp::{Instance, DEFAULT_IMPORTS};
use roc_wasm_module::WasmModule;
pub const FLAG_FUNCTION: &str = "function";
@ -88,10 +88,11 @@ fn main() -> io::Result<()> {
// Create an execution instance
let mut inst = Instance::for_module(&arena, &module, is_debug_mode).unwrap_or_else(|e| {
eprintln!("{}", e);
process::exit(2);
});
let mut inst = Instance::for_module(&arena, &module, DEFAULT_IMPORTS, is_debug_mode)
.unwrap_or_else(|e| {
eprintln!("{}", e);
process::exit(2);
});
// Run