mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 05:29:24 +00:00
Don't crash on a query where the block is not in any loop. Thanks to
Sameer D. Sahasrabuddhe for pointing this out! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22314 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e531ec583b
commit
50f5490842
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user