summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-10-20 00:13:00 +0000
committerTed Kremenek <kremenek@apple.com>2009-10-20 00:13:00 +0000
commit90c953e98fb2c9595df3a999802654af2ea8339c (patch)
treed675d9a988b13d79c0a8bea9be3e63ee1e189813 /clang/lib/Analysis/CFRefCount.cpp
parenta4a9334a5013aa3984ef9713f1a91ff70451d2f3 (diff)
downloadbcm5719-llvm-90c953e98fb2c9595df3a999802654af2ea8339c.tar.gz
bcm5719-llvm-90c953e98fb2c9595df3a999802654af2ea8339c.zip
retain/release checker: allow 'new', 'copy', 'alloc', 'init' prefix to start before '_' when determining Cocoa fundamental rule.
Fixes: <rdar://problem/7265711> llvm-svn: 84569
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 50ddbba5b2c..c629ad1d961 100644
--- a/clang/lib/Analysis/CFRefCount.cpp
+++ b/clang/lib/Analysis/CFRefCount.cpp
@@ -93,12 +93,14 @@ static NamingConvention deriveNamingConvention(Selector S) {
// Skip '_'.
if (*s == '_') {
if (InPossiblePrefix) {
+ // If we already have a convention, return it. Otherwise, skip
+ // the prefix as if it wasn't there.
+ if (C != NoConvention)
+ break;
+
InPossiblePrefix = false;
AtBeginning = true;
- // Discard whatever 'convention' we
- // had already derived since it occurs
- // in the prefix.
- C = NoConvention;
+ assert(C == NoConvention);
}
++s;
continue;
OpenPOWER on IntegriCloud