[PATCH] D151130: [NFC][CLANG] Fix static code analyzer concerns with dereference null return value

Soumi Manna via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 23 07:11:41 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG7586aeab7ad3: [NFC][CLANG] Fix static code analyzer concerns with dereference null return… (authored by Manna).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151130/new/

https://reviews.llvm.org/D151130

Files:
  clang/lib/Sema/SemaExprMember.cpp


Index: clang/lib/Sema/SemaExprMember.cpp
===================================================================
--- clang/lib/Sema/SemaExprMember.cpp
+++ clang/lib/Sema/SemaExprMember.cpp
@@ -767,7 +767,7 @@
     QualType RecordTy = BaseType;
     if (IsArrow) RecordTy = RecordTy->castAs<PointerType>()->getPointeeType();
     if (LookupMemberExprInRecord(
-            *this, R, nullptr, RecordTy->getAs<RecordType>(), OpLoc, IsArrow,
+            *this, R, nullptr, RecordTy->castAs<RecordType>(), OpLoc, IsArrow,
             SS, TemplateArgs != nullptr, TemplateKWLoc, TE))
       return ExprError();
     if (TE)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151130.524696.patch
Type: text/x-patch
Size: 616 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230523/64414f03/attachment.bin>


More information about the cfe-commits mailing list