Skip to content

Commit 228748e

Browse files
committed
[VPlan][Coverity] Fix coverity CID1579964.
Fix for the Coverity hit with CID1579964 in VPlan.cpp.
1 parent b6960e2 commit 228748e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,10 @@ void VPBasicBlock::connectToPredecessors(VPTransformState::CFGState &CFG) {
438438
// Set each forward successor here when it is created, excluding
439439
// backedges. A backward successor is set when the branch is created.
440440
unsigned idx = PredVPSuccessors.front() == this ? 0 : 1;
441-
assert(
442-
(!TermBr->getSuccessor(idx) ||
443-
(isa<VPIRBasicBlock>(this) && TermBr->getSuccessor(idx) == NewBB)) &&
444-
"Trying to reset an existing successor block.");
441+
assert((TermBr && (!TermBr->getSuccessor(idx) ||
442+
(isa<VPIRBasicBlock>(this) &&
443+
TermBr->getSuccessor(idx) == NewBB))) &&
444+
"Trying to reset an existing successor block.");
445445
TermBr->setSuccessor(idx, NewBB);
446446
}
447447
CFG.DTU.applyUpdates({{DominatorTree::Insert, PredBB, NewBB}});

0 commit comments

Comments
 (0)