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(Receiver)) { if (InnerExpr) *InnerExpr = Inner;