aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker/Store.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-07-01 20:16:50 +0000
committerTed Kremenek <kremenek@apple.com>2010-07-01 20:16:50 +0000
commitdcee3ce97fc76f20ce8f5a7451071e3dec537073 (patch)
tree16e01fa048f6f6490552b2b1eea8f71bcf9b2aae /lib/Checker/Store.cpp
parent7dadf79bd809cc01fe275f9a7243593bc2af5c10 (diff)
Fix PR 7475 by enhancing the static analyzer to also invalidate bindings for non-static global variables
when calling a function/method whose impact on global variables we cannot accurately estimate. This change introduces two new MemSpaceRegions that divide up the memory space of globals, and causes RegionStore and BasicStore to consult a binding to the NonStaticGlobalsMemSpaceRegion when lazily determining the value of a global. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107423 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/Store.cpp')
-rw-r--r--lib/Checker/Store.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/Checker/Store.cpp b/lib/Checker/Store.cpp
index c12065b89a..b128331705 100644
--- a/lib/Checker/Store.cpp
+++ b/lib/Checker/Store.cpp
@@ -91,7 +91,8 @@ const MemRegion *StoreManager::CastRegion(const MemRegion *R, QualType CastToTy)
case MemRegion::StackArgumentsSpaceRegionKind:
case MemRegion::HeapSpaceRegionKind:
case MemRegion::UnknownSpaceRegionKind:
- case MemRegion::GlobalsSpaceRegionKind: {
+ case MemRegion::NonStaticGlobalSpaceRegionKind:
+ case MemRegion::StaticGlobalSpaceRegionKind: {
assert(0 && "Invalid region cast");
break;
}
@@ -232,17 +233,6 @@ SVal StoreManager::CastRetrievedVal(SVal V, const TypedRegion *R,
return V;
}
-Store StoreManager::InvalidateRegions(Store store,
- const MemRegion * const *I,
- const MemRegion * const *End,
- const Expr *E, unsigned Count,
- InvalidatedSymbols *IS) {
- for ( ; I != End ; ++I)
- store = InvalidateRegion(store, *I, E, Count, IS);
-
- return store;
-}
-
SVal StoreManager::getLValueFieldOrIvar(const Decl* D, SVal Base) {
if (Base.isUnknownOrUndef())
return Base;