diff options
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r-- | lib/Analysis/CFRefCount.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index e45b3b37f8..c8d0bf78ae 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -179,7 +179,7 @@ public: Pred); assert(ENB); - return ENB->MakeNode(state, Pred); + return ENB->generateNode(state, Pred); } }; } // end anonymous namespace @@ -1552,6 +1552,10 @@ void RefVal::print(std::ostream& Out) const { case ErrorReleaseNotOwned: Out << "Release of Not-Owned [ERROR]"; break; + + case RefVal::ErrorOverAutorelease: + Out << "Over autoreleased"; + break; } if (ACnt) { @@ -3185,8 +3189,14 @@ CFRefCount::HandleAutoreleaseCounts(GRStateRef state, GenericNodeBuilder Bd, unsigned Cnt = V.getCount(); if (ACnt <= Cnt) { - V.setCount(Cnt - ACnt); - V.setAutoreleaseCount(0); + if (ACnt == Cnt) { + V.clearCounts(); + V = V ^ RefVal::NotOwned; + } + else { + V.setCount(Cnt - ACnt); + V.setAutoreleaseCount(0); + } state = state.set<RefBindings>(Sym, V); ExplodedNode<GRState> *N = Bd.MakeNode(state, Pred); stop = (N == 0); @@ -3200,6 +3210,7 @@ CFRefCount::HandleAutoreleaseCounts(GRStateRef state, GenericNodeBuilder Bd, state = state.set<RefBindings>(Sym, V); if (ExplodedNode<GRState> *N = Bd.MakeNode(state, Pred)) { + N->markAsSink(); CFRefReport *report = new CFRefReport(*static_cast<CFRefBug*>(overAutorelease), *this, N, Sym); |