diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp
index abf5d3ec193a4..5d28982c41fc4 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp
@@ -163,10 +163,11 @@ bool isConstOwnerPtrMemberExpr(const clang::Expr *E) {
     if (OCE->getOperator() == OO_Star && OCE->getNumArgs() == 1)
       E = OCE->getArg(0);
   }
-  auto *ME = dyn_cast<MemberExpr>(E);
-  if (!ME)
-    return false;
-  auto *D = ME->getMemberDecl();
+  const ValueDecl *D = nullptr;
+  if (auto *ME = dyn_cast<MemberExpr>(E))
+    D = ME->getMemberDecl();
+  else if (auto *IVR = dyn_cast<ObjCIvarRefExpr>(E))
+    D = IVR->getDecl();
   if (!D)
     return false;
   auto T = D->getType();
diff --git a/clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.mm b/clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.mm
index 9ad1880e9d118..08319016023e3 100644
--- a/clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.mm
+++ b/clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.mm
@@ -1,11 +1,14 @@
 // RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s
-// expected-no-diagnostics
 
 #import "mock-types.h"
 #import "mock-system-header.h"
 #import "../../Inputs/system-header-simulator-for-objc-dealloc.h"
 
-@interface Foo : NSObject
+@interface Foo : NSObject {
+  const Ref<RefCountable> _obj1;
+  const RefPtr<RefCountable> _obj2;
+  Ref<RefCountable> _obj3;
+}
 
 @property (nonatomic, readonly) RefPtr<RefCountable> countable;
 
@@ -17,6 +20,11 @@ @implementation Foo
 
 - (void)execute {
   self._protectedRefCountable->method();
+  _obj1->method();
+  _obj1.get().method();
+  (*_obj2).method();
+  _obj3->method();
+  // expected-warning@-1{{Call argument for 'this' parameter is uncounted and unsafe}}
 }
 
 - (RefPtr<RefCountable>)_protectedRefCountable {
@@ -30,6 +38,7 @@ - (void)execute {
   void ref() const;
   void deref() const;
   Ref<RefCountedObject> copy() const;
+  void method();
 };
 
 @interface WrapperObj : NSObject