mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 23:23:38 -04:00
DivergenceAnalysis: Fix crash with no return blocks
The post dominator tree does not have a root node in this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268933 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -143,7 +143,13 @@ void DivergencePropagator::exploreSyncDependency(TerminatorInst *TI) {
|
||||
if (!DT.isReachableFromEntry(ThisBB))
|
||||
return;
|
||||
|
||||
BasicBlock *IPostDom = PDT.getNode(ThisBB)->getIDom()->getBlock();
|
||||
// If the function has no exit blocks or doesn't reach any exit blocks, the
|
||||
// post dominator may be null.
|
||||
DomTreeNode *ThisNode = PDT.getNode(ThisBB);
|
||||
if (!ThisNode)
|
||||
return;
|
||||
|
||||
BasicBlock *IPostDom = ThisNode->getIDom()->getBlock();
|
||||
if (IPostDom == nullptr)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user