Add "GetSValAsScalarOrLoc" methods to GRState/GRStateRef that only perform a
retrieval from the store/environment for locations or scalar types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65982 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/GRState.cpp b/lib/Analysis/GRState.cpp
index eb6b1b5..85a85f2 100644
--- a/lib/Analysis/GRState.cpp
+++ b/lib/Analysis/GRState.cpp
@@ -257,7 +257,7 @@
}
bool ScanReachableSymbols::scan(const MemRegion *R) {
- if (visited.count(R))
+ if (isa<MemSpaceRegion>(R) || visited.count(R))
return true;
visited.insert(R);
@@ -273,7 +273,7 @@
return false;
// Now look at the binding to this region (if any).
- if (!scan(state.GetSVal(R)))
+ if (!scan(state.GetSValAsScalarOrLoc(R)))
return false;
// Now look at the subregions.