Fixes case with empty module, handle case with no signatures

This commit is contained in:
Brandon Fish 2019-07-26 17:58:57 -05:00
parent 53c343bc6f
commit d7c11bcf5f

View File

@ -304,8 +304,15 @@ impl ModuleCodeGenerator<CraneliftFunctionCodeGenerator, Caller, CodegenError>
let trampolines = Arc::new(Trampolines::new(&*self.isa, module_info));
let signatures_empty = Map::new();
let signatures = if self.signatures.is_some() {
&self.signatures.as_ref().unwrap()
} else {
&signatures_empty
};
let (func_resolver, backend_cache) = func_resolver_builder.finalize(
&self.signatures.as_ref().unwrap(),
signatures,
Arc::clone(&trampolines),
handler_data.clone(),
)?;