summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/BasicStore.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-10-16 00:30:49 +0000
committerTed Kremenek <kremenek@apple.com>2009-10-16 00:30:49 +0000
commit1eb68096a21aa10a8e11ebb67c56b6bb4d794129 (patch)
treeb6a620a6184a41d52f570dc79595ded739478efd /clang/lib/Analysis/BasicStore.cpp
parentc5b8225285fb47be39fe0af7f3339844e39f2d35 (diff)
downloadbcm5719-llvm-1eb68096a21aa10a8e11ebb67c56b6bb4d794129.tar.gz
bcm5719-llvm-1eb68096a21aa10a8e11ebb67c56b6bb4d794129.zip
retain/release checker: Stop tracking reference counts for any symbols touched by StoreManager::InvalidateRegion().
This fixes <rdar://problem/7257223> and <rdar://problem/7283470>. llvm-svn: 84223
Diffstat (limited to 'clang/lib/Analysis/BasicStore.cpp')
-rw-r--r--clang/lib/Analysis/BasicStore.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/clang/lib/Analysis/BasicStore.cpp b/clang/lib/Analysis/BasicStore.cpp
index a4f451f3649..d81d83c7bfa 100644
--- a/clang/lib/Analysis/BasicStore.cpp
+++ b/clang/lib/Analysis/BasicStore.cpp
@@ -49,7 +49,8 @@ public:
QualType T = QualType());
const GRState *InvalidateRegion(const GRState *state, const MemRegion *R,
- const Expr *E, unsigned Count);
+ const Expr *E, unsigned Count,
+ InvalidatedSymbols *IS);
const GRState *Bind(const GRState *state, Loc L, SVal V) {
return state->makeWithStore(BindInternal(state->getStore(), L, V));
@@ -623,12 +624,21 @@ StoreManager::BindingsHandler::~BindingsHandler() {}
const GRState *BasicStoreManager::InvalidateRegion(const GRState *state,
const MemRegion *R,
const Expr *E,
- unsigned Count) {
+ unsigned Count,
+ InvalidatedSymbols *IS) {
R = R->getBaseRegion();
if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R)))
return state;
+ if (IS) {
+ BindingsTy B = GetBindings(state->getStore());
+ if (BindingsTy::data_type *Val = B.lookup(R)) {
+ if (SymbolRef Sym = Val->getAsSymbol())
+ IS->insert(Sym);
+ }
+ }
+
QualType T = cast<TypedRegion>(R)->getValueType(R->getContext());
SVal V = ValMgr.getConjuredSymbolVal(R, E, T, Count);
return Bind(state, loc::MemRegionVal(R), V);
OpenPOWER on IntegriCloud