Initial support for function, table, memory, and global imports.

This commit is contained in:
Dan Gohman
2018-12-08 17:38:28 -05:00
parent 93f33141e9
commit 56850d481d
45 changed files with 3181 additions and 2181 deletions

View File

@@ -94,7 +94,7 @@ fn main() {
}
let isa = isa_builder.finish(settings::Flags::new(flag_builder));
let mut wast_context = WastContext::new();
let mut wast_context = WastContext::new().expect("Error creating WastContext");
for filename in &args.arg_file {
wast_context
.run_file(&*isa, Path::new(&filename))

View File

@@ -184,11 +184,13 @@ fn handle_module(args: &Args, path: &Path, isa: &TargetIsa) -> Result<(), String
if split.len() != 3 {
break;
}
let memory = world.inspect_memory(
MemoryIndex::new(str::parse(split[0]).unwrap()),
str::parse(split[1]).unwrap(),
str::parse(split[2]).unwrap(),
);
let memory = world
.inspect_memory(
MemoryIndex::new(str::parse(split[0]).unwrap()),
str::parse(split[1]).unwrap(),
str::parse(split[2]).unwrap(),
)
.map_err(|e| e.to_string())?;
let mut s = memory.iter().fold(String::from("#"), |mut acc, byte| {
acc.push_str(format!("{:02x}_", byte).as_str());
acc