aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r--lib/Analysis/CFRefCount.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index 81faf21653..8fea99b4f6 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -1284,6 +1284,7 @@ public:
private:
RetainSummaryManager Summaries;
+ llvm::DenseMap<const GRExprEngine::NodeTy*, const RetainSummary*> SummaryLog;
const LangOptions& LOpts;
BugType *useAfterRelease, *releaseNotOwned;
@@ -1655,11 +1656,15 @@ void CFRefCount::EvalSummary(ExplodedNodeSet<GRState>& Dst,
}
}
- // Is this a sink?
- if (IsEndPath(Summ))
- Builder.MakeSinkNode(Dst, Ex, Pred, state);
- else
- Builder.MakeNode(Dst, Ex, Pred, state);
+ // Generate a sink node if we are at the end of a path.
+ GRExprEngine::NodeTy *NewNode =
+ IsEndPath(Summ) ? Builder.MakeSinkNode(Dst, Ex, Pred, state)
+ : Builder.MakeNode(Dst, Ex, Pred, state);
+
+ // Annotate the edge with summary we used.
+ // FIXME: This assumes that we always use the same summary when generating
+ // this node.
+ if (NewNode) SummaryLog[NewNode] = Summ;
}