aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-05-14 21:29:16 +0000
committerTed Kremenek <kremenek@apple.com>2009-05-14 21:29:16 +0000
commit304376651e85a6f84055ffa0b42517f8631e7f6b (patch)
tree7fd348a91beb781fe93886761944801b9733bb24 /lib/Analysis/CFRefCount.cpp
parentb5133c279f86e04f71c9dd5d581ecfedf1f5e7eb (diff)
Fix <rdar://problem/6859457> [NSData dataWithBytesNoCopy] does not return a retained object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71797 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r--lib/Analysis/CFRefCount.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index e00ede090b..4b2c394c88 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -1338,6 +1338,15 @@ void RetainSummaryManager::InitializeClassMethodSummaries() {
"withObject", "waitUntilDone", "modes", NULL);
addClsMethSummary(NSObjectII, Summ, "performSelectorInBackground",
"withObject", NULL);
+
+ // Specially handle NSData.
+ RetainSummary *dataWithBytesNoCopySumm =
+ getPersistentSummary(RetEffect::MakeNotOwned(RetEffect::ObjC), DoNothing,
+ DoNothing);
+ addClsMethSummary("NSData", dataWithBytesNoCopySumm,
+ "dataWithBytesNoCopy", "length", NULL);
+ addClsMethSummary("NSData", dataWithBytesNoCopySumm,
+ "dataWithBytesNoCopy", "length", "freeWhenDone", NULL);
}
void RetainSummaryManager::InitializeMethodSummaries() {