From d7c11bcf5fdeb5c95a4ee8d2f10b392ae69cff78 Mon Sep 17 00:00:00 2001 From: Brandon Fish Date: Fri, 26 Jul 2019 17:58:57 -0500 Subject: [PATCH] Fixes case with empty module, handle case with no signatures --- lib/clif-backend/src/code.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/clif-backend/src/code.rs b/lib/clif-backend/src/code.rs index 576f513e1..947ea88e2 100644 --- a/lib/clif-backend/src/code.rs +++ b/lib/clif-backend/src/code.rs @@ -304,8 +304,15 @@ impl ModuleCodeGenerator 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(), )?;