Skip to content

Commit 3a396b9

Browse files
committed
[MachineBB] Make sure there are successors in terminatorIsComputedGoto.
1 parent 635e6d7 commit 3a396b9

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
@@ -326,7 +326,7 @@ class MachineBasicBlock
326326
/// Returns true if the original IR terminator is an `indirectbr`. This
327327
/// typically corresponds to a `goto` in C, rather than jump tables.
328328
bool terminatorIsComputedGoto() const {
329-
return back().isIndirectBranch() &&
329+
return back().isIndirectBranch() && !succ_empty() &&
330330
llvm::all_of(successors(), [](const MachineBasicBlock *Succ) {
331331
return Succ->isIRBlockAddressTaken();
332332
});

0 commit comments

Comments
 (0)