Skip to content

Commit

Permalink
Merge #586
Browse files Browse the repository at this point in the history
586: Fixes case with empty module, handle case with no signatures r=bjfish a=bjfish

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:373:21

Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
  • Loading branch information
bors[bot] and bjfish committed Jul 26, 2019
2 parents 53c343b + d7c11bc commit f483c89
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/clif-backend/src/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)?;
Expand Down

0 comments on commit f483c89

Please sign in to comment.