[clang] [alpha.webkit.UnretainedCallArgsChecker] Add a checker for NS or CF type call arguments. (PR #128586)

Rashmi Mudduluru via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 10 20:28:58 PDT 2025


================
@@ -28,6 +29,15 @@ bool tryToFindPtrOrigin(
     std::function<bool(const clang::QualType)> isSafePtrType,
     std::function<bool(const clang::Expr *, bool)> callback) {
   while (E) {
+    if (auto *DRE = dyn_cast<DeclRefExpr>(E)) {
+      auto *ValDecl = DRE->getDecl();
+      auto QT = ValDecl->getType();
+      auto ValName = ValDecl->getName();
+      if (ValDecl && (ValName.starts_with('k') || ValName.starts_with("_k")) &&
----------------
t-rasmud wrote:

Do the kCF~ and _kCF constants need to be handled or are they supposed to be ignored? Add a code comment clarifying this?

https://github.com/llvm/llvm-project/pull/128586


More information about the cfe-commits mailing list