[alpha.webkit.UncountedCallArgsChecker] Treat CFEqual as a safe function (#146369)

CFEqual is a trivial function, so treat it as safe.
This commit is contained in:
Rob Buis
2025-07-01 13:57:53 +01:00
committed by GitHub
parent 6731f151ea
commit 524f090306
3 changed files with 14 additions and 1 deletions

View File

@@ -294,7 +294,7 @@ public:
if (name == "adoptRef" || name == "getPtr" || name == "WeakPtr" ||
name == "is" || name == "equal" || name == "hash" || name == "isType" ||
// FIXME: Most/all of these should be implemented via attributes.
name == "equalIgnoringASCIICase" ||
name == "CFEqual" || name == "equalIgnoringASCIICase" ||
name == "equalIgnoringASCIICaseCommon" ||
name == "equalIgnoringNullity" || name == "toString")
return true;

View File

@@ -0,0 +1,12 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s
// expected-no-diagnostics
#include "objc-mock-types.h"
CGImageRef provideImage();
Boolean cfe(CFTypeRef obj)
{
return CFEqual(obj, provideImage());
}

View File

@@ -45,6 +45,7 @@ CFDictionaryRef CFDictionaryCreateCopy(CFAllocatorRef allocator, CFDictionaryRef
CFDictionaryRef CFDictionaryCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFDictionaryRef theDict);
CFIndex CFDictionaryGetCount(CFDictionaryRef theDict);
Boolean CFDictionaryContainsKey(CFDictionaryRef theDict, const void *key);
Boolean CFEqual(CFTypeRef, CFTypeRef);
Boolean CFDictionaryContainsValue(CFDictionaryRef theDict, const void *value);
const void *CFDictionaryGetValue(CFDictionaryRef theDict, const void *key);
void CFDictionaryAddValue(CFMutableDictionaryRef theDict, const void *key, const void *value);