Skip to content

Commit b1ed553

Browse files
committed
[MachineBB] Make sure there are successors in terminatorIsComputedGoto.
1 parent cad5328 commit b1ed553

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/CodeGen/MachineBasicBlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ class MachineBasicBlock
327327
/// typically corresponds to a `goto` in C, rather than jump tables.
328328
bool terminatorIsComputedGoto() const {
329329
return back().isIndirectBranch() &&
330-
llvm::all_of(successors(), [](const MachineBasicBlock *Succ) {
330+
!succ_empty() && llvm::all_of(successors(), [](const MachineBasicBlock *Succ) {
331331
return Succ->isIRBlockAddressTaken();
332332
});
333333
}

0 commit comments

Comments
 (0)