Correctly handle 'Class<...>' when examining Cocoa conventions in the static analyzer. Fixes a crash reported in <rdar://problem/8272168>. Patch by Henry Mason!

llvm-svn: 110289
This commit is contained in:
Ted Kremenek 2010-08-05 00:19:24 +00:00
parent 8a297e9f27
commit 1d08fd9b79
2 changed files with 12 additions and 2 deletions

View File

@ -173,9 +173,10 @@ bool cocoa::isCocoaObjectRef(QualType Ty) {
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?

View File

@ -1358,3 +1358,12 @@ void test_blocks_1_indirect_retain_via_call(void) {
}
@end
// <rdar://problem/8272168> - Correcly handle Class<...> in Cocoa Conventions
// detector.
@protocol Prot_R8272168 @end
Class <Prot_R8272168> GetAClassThatImplementsProt_R8272168();
void r8272168() {
GetAClassThatImplementsProt_R8272168();
}