forked from OSchip/llvm-project
[DivergenceAnalysis] Fix static analyzer warning about dereference of nullptr
We're testing that the RegionLoop pointer is null in the first part of the check, so we need to check that its non-null before dereferencing it in a later part of the check.
This commit is contained in:
parent
274359cf09
commit
b3f193a980
|
@ -130,7 +130,8 @@ bool DivergenceAnalysisImpl::inRegion(const Instruction &I) const {
|
|||
}
|
||||
|
||||
bool DivergenceAnalysisImpl::inRegion(const BasicBlock &BB) const {
|
||||
return (!RegionLoop && BB.getParent() == &F) || RegionLoop->contains(&BB);
|
||||
return (!RegionLoop && BB.getParent() == &F) ||
|
||||
(RegionLoop && RegionLoop->contains(&BB));
|
||||
}
|
||||
|
||||
void DivergenceAnalysisImpl::pushUsers(const Value &V) {
|
||||
|
|
Loading…
Reference in New Issue