diff --git a/cranelift/codegen/src/machinst/reg.rs b/cranelift/codegen/src/machinst/reg.rs index 2d727559c9..3bf4ca6f9d 100644 --- a/cranelift/codegen/src/machinst/reg.rs +++ b/cranelift/codegen/src/machinst/reg.rs @@ -496,7 +496,12 @@ impl<'a> AllocationConsumer<'a> { ) }); - assert_eq!(preg, alloc.unwrap().to_real_reg().unwrap().into()); + match alloc { + Some(alloc) => { + assert_eq!(preg, alloc.to_real_reg().unwrap().into()); + }, + None => {} + } } pub fn next(&mut self, pre_regalloc_reg: Reg) -> Reg {