[clang] [alpha.webkit.UnretainedCallArgsChecker] Add a checker for NS or CF type call arguments. (PR #128586)
Ryosuke Niwa via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 10 23:11:45 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")) &&
----------------
rniwa wrote:
They need to be treated as safe. Will add a comment.
https://github.com/llvm/llvm-project/pull/128586
More information about the cfe-commits
mailing list