diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-03-28 23:02:18 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-03-28 23:02:18 +0000 |
commit | 96f962fdffab615f196ea6b66ea736ca2c601548 (patch) | |
tree | c841402eb745404978a043d54ce79b59d20d2c61 /llvm/lib/CodeGen | |
parent | 67919b2a5b6d5e6a12ca71e2b24f2125fb7d63ff (diff) | |
download | bcm5719-llvm-96f962fdffab615f196ea6b66ea736ca2c601548.tar.gz bcm5719-llvm-96f962fdffab615f196ea6b66ea736ca2c601548.zip |
In some cases, the "fail BB dominator" may be null after the BB was split (and
becomes reachable when before it wasn't). Check to make sure that it's not null
before trying to use it.
llvm-svn: 128434
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/StackProtector.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/StackProtector.cpp b/llvm/lib/CodeGen/StackProtector.cpp index 02d8fd6dea9..1a588e25d6e 100644 --- a/llvm/lib/CodeGen/StackProtector.cpp +++ b/llvm/lib/CodeGen/StackProtector.cpp @@ -221,7 +221,8 @@ bool StackProtector::InsertStackProtectors() { BasicBlock *NewBB = BB->splitBasicBlock(RI, "SP_return"); if (DT && DT->isReachableFromEntry(BB)) { DT->addNewBlock(NewBB, BB); - FailBBDom = DT->findNearestCommonDominator(FailBBDom, BB); + if (FailBBDom) + FailBBDom = DT->findNearestCommonDominator(FailBBDom, BB); } // Remove default branch instruction to the new BB. |