Skip to content
Browse files

[OSG 24291889] Protect against bad call to AsBranchInstr

  • Loading branch information
pleath committed Dec 20, 2019
1 parent b8dbdf1 commit d26afd47ac1f5abbc4c7827345e79eafd35f55aa
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Backend/BackwardPass.cpp
@@ -8432,7 +8432,7 @@ BackwardPass::ProcessBailOnNoProfile(IR::Instr *instr, BasicBlock *block)
// We already have one, we don't need a second.
else if (!predInstr->AsBranchInstr()->m_isSwitchBr)
else if (predInstr->IsBranchInstr() && !predInstr->AsBranchInstr()->m_isSwitchBr)
// Don't put a bailout in the middle of a switch dispatch sequence.
// The bytecode offsets are not in order, and it would lead to incorrect

0 comments on commit d26afd4

Please sign in to comment.
You can’t perform that action at this time.