Skip to content

Commit d26afd4

Browse files
committed
[OSG 24291889] Protect against bad call to AsBranchInstr
1 parent b8dbdf1 commit d26afd4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Backend/BackwardPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8432,7 +8432,7 @@ BackwardPass::ProcessBailOnNoProfile(IR::Instr *instr, BasicBlock *block)
84328432
// We already have one, we don't need a second.
84338433
instrCopy->Free();
84348434
}
8435-
else if (!predInstr->AsBranchInstr()->m_isSwitchBr)
8435+
else if (predInstr->IsBranchInstr() && !predInstr->AsBranchInstr()->m_isSwitchBr)
84368436
{
84378437
// Don't put a bailout in the middle of a switch dispatch sequence.
84388438
// The bytecode offsets are not in order, and it would lead to incorrect

0 commit comments

Comments
 (0)