summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-08-20 00:57:22 +0000
committerTed Kremenek <kremenek@apple.com>2009-08-20 00:57:22 +0000
commitd982f001c9ae63ae29525ece3dc1b9ee412f2182 (patch)
tree0e8cdbf787f27af7f511c4187d01b99520522783 /clang/lib/Analysis/CFRefCount.cpp
parent2689c3be010b82cac28953687617908d992537b2 (diff)
downloadbcm5719-llvm-d982f001c9ae63ae29525ece3dc1b9ee412f2182.tar.gz
bcm5719-llvm-d982f001c9ae63ae29525ece3dc1b9ee412f2182.zip
retain/release checker: Special case handling of CFAttributedStringSetAttribute,
fixing <rdar://problem/7152619>. Along the way, merge test cases in 'test/Analysis/rdar-6539791.c' into 'test/Analysis/retain-release.m'. llvm-svn: 79499
Diffstat (limited to 'clang/lib/Analysis/CFRefCount.cpp')
-rw-r--r--clang/lib/Analysis/CFRefCount.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp
index c441e0e2420..b965393601c 100644
--- a/clang/lib/Analysis/CFRefCount.cpp
+++ b/clang/lib/Analysis/CFRefCount.cpp
@@ -1128,13 +1128,15 @@ RetainSummary* RetainSummaryManager::getSummary(FunctionDecl* FD) {
// ... it is okay to use 'x' since 'y' has a reference to it
//
// We handle this and similar cases with the follow heuristic. If the
- // function name contains "InsertValue", "SetValue" or "AddValue" then
- // we assume that arguments may "escape."
- //
+ // function name contains "InsertValue", "SetValue", "AddValue",
+ // "AppendValue", or "SetAttribute", then we assume that arguments may
+ // "escape." This means that something else holds on to the object,
+ // allowing it be used even after its local retain count drops to 0.
ArgEffect E = (CStrInCStrNoCase(FName, "InsertValue") ||
CStrInCStrNoCase(FName, "AddValue") ||
CStrInCStrNoCase(FName, "SetValue") ||
- CStrInCStrNoCase(FName, "AppendValue"))
+ CStrInCStrNoCase(FName, "AppendValue") ||
+ CStrInCStrNoCase(FName, "SetAttribute"))
? MayEscape : DoNothing;
S = getPersistentSummary(RetEffect::MakeNoRet(), DoNothing, E);
OpenPOWER on IntegriCloud