aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-12-18 23:34:57 +0000
committerTed Kremenek <kremenek@apple.com>2008-12-18 23:34:57 +0000
commit40e86d9be7e7a7343350af9d6cd86e7991d85eb1 (patch)
tree04f0f9bfde649a44fb78311fb358f89f23208714 /lib/Analysis/CFRefCount.cpp
parent7e0fbb2561fadf8c1fce5fdb588f5db2f3cae51f (diff)
Fix regression when invalidating reference-counts for objects passed-by-reference to a function/method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61224 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r--lib/Analysis/CFRefCount.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index c85d934ebb..90a54d6353 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -1589,14 +1589,6 @@ void CFRefCount::EvalSummary(ExplodedNodeSet<GRState>& Dst,
// to identify conjured symbols by an expression pair: the enclosing
// expression (the context) and the expression itself. This should
// disambiguate conjured symbols.
-
- // Is the invalidated variable something that we were tracking?
- SVal X = state.GetSVal(*MR);
-
- if (isa<loc::SymbolVal>(X)) {
- SymbolRef Sym = cast<loc::SymbolVal>(X).getSymbol();
- state = state.remove<RefBindings>(Sym);
- }
const TypedRegion* R = dyn_cast<TypedRegion>(MR->getRegion());
@@ -1608,6 +1600,15 @@ void CFRefCount::EvalSummary(ExplodedNodeSet<GRState>& Dst,
}
if (R) {
+
+ // Is the invalidated variable something that we were tracking?
+ SVal X = state.GetSVal(Loc::MakeVal(R));
+
+ if (isa<loc::SymbolVal>(X)) {
+ SymbolRef Sym = cast<loc::SymbolVal>(X).getSymbol();
+ state = state.remove<RefBindings>(Sym);
+ }
+
// Set the value of the variable to be a conjured symbol.
unsigned Count = Builder.getCurrentBlockCount();
QualType T = R->getRValueType(Ctx);