diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-03-13 20:27:06 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-03-13 20:27:06 +0000 |
commit | 340fd2dd6edb2d36f290eb121956c47a2cc3e904 (patch) | |
tree | dad021f41a3b75c39ca799edb5cbf8571bd6a834 /clang/lib/Analysis/CFRefCount.cpp | |
parent | 997b74ac6167d96631677884ece9cf90d896ac00 (diff) | |
download | bcm5719-llvm-340fd2dd6edb2d36f290eb121956c47a2cc3e904.tar.gz bcm5719-llvm-340fd2dd6edb2d36f290eb121956c47a2cc3e904.zip |
Fix PR 3677 [retain checker]: custom 'allocWithZone' methods should be allowed
to return an owning pointer.
llvm-svn: 66934
Diffstat (limited to 'clang/lib/Analysis/CFRefCount.cpp')
-rw-r--r-- | clang/lib/Analysis/CFRefCount.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp index 75a9f3dca10..b6c11c9cfc8 100644 --- a/clang/lib/Analysis/CFRefCount.cpp +++ b/clang/lib/Analysis/CFRefCount.cpp @@ -119,12 +119,15 @@ static NamingConvention deriveNamingConvention(const char* s) { case 4: // Methods starting with 'alloc' or contain 'copy' follow the // create rule - if ((AtBeginning && StringsEqualNoCase("alloc", s, len)) || - (C == NoConvention && StringsEqualNoCase("copy", s, len))) + if (C == NoConvention && StringsEqualNoCase("copy", s, len)) C = CreateRule; else // Methods starting with 'init' follow the init rule. if (AtBeginning && StringsEqualNoCase("init", s, len)) - C = InitRule; + C = InitRule; + break; + case 5: + if (AtBeginning && StringsEqualNoCase("alloc", s, len)) + C = CreateRule; break; } |