diff options
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/Analysis/LoopInfo.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/include/llvm/Analysis/LoopInfo.h b/llvm/include/llvm/Analysis/LoopInfo.h index 5e818bcbe19..9357d8fb6ea 100644 --- a/llvm/include/llvm/Analysis/LoopInfo.h +++ b/llvm/include/llvm/Analysis/LoopInfo.h @@ -250,7 +250,8 @@ public: // isLoopHeader - True if the block is a loop header node bool isLoopHeader(BasicBlock *BB) const { - return getLoopFor(BB)->getHeader() == BB; + const Loop *L = getLoopFor(BB); + return L && L->getHeader() == BB; } /// runOnFunction - Calculate the natural loop information. |

