Fix early-return logic in scanReachableSymbols() to match the rest of the recursive logic in the methods of ScanReachableSymbols.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90245 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/GRState.cpp b/lib/Analysis/GRState.cpp
index a56859d..7415fa5 100644
--- a/lib/Analysis/GRState.cpp
+++ b/lib/Analysis/GRState.cpp
@@ -312,10 +312,10 @@
SymbolVisitor &visitor) const {
ScanReachableSymbols S(this, visitor);
for ( ; I != E; ++I) {
- if (S.scan(*I))
- return true;
+ if (!S.scan(*I))
+ return false;
}
- return false;
+ return true;
}
bool GRState::scanReachableSymbols(const MemRegion * const *I,
@@ -323,10 +323,10 @@
SymbolVisitor &visitor) const {
ScanReachableSymbols S(this, visitor);
for ( ; I != E; ++I) {
- if (S.scan(*I))
- return true;
+ if (!S.scan(*I))
+ return false;
}
- return false;
+ return true;
}
//===----------------------------------------------------------------------===//