diff --git a/cranelift/codegen/src/machinst/blockorder.rs b/cranelift/codegen/src/machinst/blockorder.rs index 98a150d745..6a4b5a5b47 100644 --- a/cranelift/codegen/src/machinst/blockorder.rs +++ b/cranelift/codegen/src/machinst/blockorder.rs @@ -258,13 +258,15 @@ impl BlockLoweringOrder { match lb { LoweredBlock::Orig { block, cold, .. } => { match lb_to_bindex.get(&LoweredBlock::Orig { block: *block, cold: *cold, indirect_branch_target: indirect_branch_target_clif_blocks.contains(block) } ) { - Some(idx) => idx, + Some(idx) => *idx, None => { panic!("Trying to hashlookup {:?} in HashMap: {:?}", lb, lb_to_bindex); } } }, - _ => panic!("Invalid block type in block_succs") + LoweredBlock::CriticalEdge { .. } => { + lb_to_bindex[&lb] + } } }));