[clang] 992e928 - [alpha.webkit.RetainPtrCtorAdoptChecker] Check nullity before calling IgnoreParenCasts. (#137556)

via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 27 15:45:06 PDT 2025


Author: Ryosuke Niwa
Date: 2025-04-27T15:45:03-07:00
New Revision: 992e92864142ef3e3313b7cbc11d5724ded414a7

URL: https://github.com/llvm/llvm-project/commit/992e92864142ef3e3313b7cbc11d5724ded414a7
DIFF: https://github.com/llvm/llvm-project/commit/992e92864142ef3e3313b7cbc11d5724ded414a7.diff

LOG: [alpha.webkit.RetainPtrCtorAdoptChecker] Check nullity before calling IgnoreParenCasts. (#137556)

Added: 
    

Modified: 
    clang/lib/StaticAnalyzer/Checkers/WebKit/RetainPtrCtorAdoptChecker.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/RetainPtrCtorAdoptChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/RetainPtrCtorAdoptChecker.cpp
index bba1d48e6db11..34c98daa78049 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/RetainPtrCtorAdoptChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/RetainPtrCtorAdoptChecker.cpp
@@ -444,9 +444,10 @@ class RetainPtrCtorAdoptChecker
       return false;
     if (!ObjCMsgExpr->isInstanceMessage())
       return false;
-    auto *Receiver = ObjCMsgExpr->getInstanceReceiver()->IgnoreParenCasts();
+    auto *Receiver = ObjCMsgExpr->getInstanceReceiver();
     if (!Receiver)
       return false;
+    Receiver = Receiver->IgnoreParenCasts();
     if (auto *Inner = dyn_cast<ObjCMessageExpr>(Receiver)) {
       if (InnerExpr)
         *InnerExpr = Inner;


        


More information about the cfe-commits mailing list