[cfe-commits] r110289 - in /cfe/trunk: lib/Checker/CocoaConventions.cpp test/Analysis/retain-release.m
Ted Kremenek
kremenek at apple.com
Wed Aug 4 17:19:25 PDT 2010
Author: kremenek
Date: Wed Aug 4 19:19:24 2010
New Revision: 110289
URL: http://llvm.org/viewvc/llvm-project?rev=110289&view=rev
Log:
Correctly handle 'Class<...>' when examining Cocoa conventions in the static analyzer. Fixes a crash reported in <rdar://problem/8272168>. Patch by Henry Mason!
Modified:
cfe/trunk/lib/Checker/CocoaConventions.cpp
cfe/trunk/test/Analysis/retain-release.m
Modified: cfe/trunk/lib/Checker/CocoaConventions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/CocoaConventions.cpp?rev=110289&r1=110288&r2=110289&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/CocoaConventions.cpp (original)
+++ cfe/trunk/lib/Checker/CocoaConventions.cpp Wed Aug 4 19:19:24 2010
@@ -173,9 +173,10 @@
if (!PT)
return true;
- // We assume that id<..>, id, and "Class" all represent tracked objects.
+ // We assume that id<..>, id, Class, and Class<..> all represent tracked
+ // objects.
if (PT->isObjCIdType() || PT->isObjCQualifiedIdType() ||
- PT->isObjCClassType())
+ PT->isObjCClassType() || PT->isObjCQualifiedClassType())
return true;
// Does the interface subclass NSObject?
Modified: cfe/trunk/test/Analysis/retain-release.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/retain-release.m?rev=110289&r1=110288&r2=110289&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/retain-release.m (original)
+++ cfe/trunk/test/Analysis/retain-release.m Wed Aug 4 19:19:24 2010
@@ -1358,3 +1358,12 @@
}
@end
+// <rdar://problem/8272168> - Correcly handle Class<...> in Cocoa Conventions
+// detector.
+
+ at protocol Prot_R8272168 @end
+Class <Prot_R8272168> GetAClassThatImplementsProt_R8272168();
+void r8272168() {
+ GetAClassThatImplementsProt_R8272168();
+}
+
More information about the cfe-commits
mailing list