diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-10-20 00:13:00 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-10-20 00:13:00 +0000 |
commit | e9731832ec3b995defba821ec24343d74d004f9f (patch) | |
tree | 8ce07f483d8b7ba82171b8cd5bf3ef1db69382a8 /lib/Analysis/CFRefCount.cpp | |
parent | 035c46fee8dd0a4e5a21fc29674297d41da9ec96 (diff) |
retain/release checker: allow 'new', 'copy', 'alloc', 'init' prefix to start before '_' when determining Cocoa fundamental rule.
Fixes: <rdar://problem/7265711>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84569 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFRefCount.cpp')
-rw-r--r-- | lib/Analysis/CFRefCount.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index 50ddbba5b2..c629ad1d96 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/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; |