Remove unwrap() for branch folding
This commit is contained in:
committed by
Dan Gohman
parent
4ee2747c5b
commit
d8d573208b
@@ -232,7 +232,10 @@ fn fold_branch(pos: &mut FuncCursor, inst: ir::Inst, opcode: ir::Opcode) {
|
||||
let values = pos.func.dfg.inst_args(inst);
|
||||
let inst_data = &pos.func.dfg[inst];
|
||||
(
|
||||
resolve_value_to_imm(&pos.func.dfg, values[0]).unwrap(),
|
||||
match resolve_value_to_imm(&pos.func.dfg, values[0]) {
|
||||
Some(imm) => imm,
|
||||
None => return,
|
||||
},
|
||||
inst_data.branch_destination().unwrap(),
|
||||
values[1..].to_vec(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user