[PATCH] D149922: Fix nullptr dereference found by Coverity static analysis tool

Soumi Manna via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 5 08:06:23 PDT 2023


Manna updated this revision to Diff 519859.
Manna added a comment.

I have updated patch


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

https://reviews.llvm.org/D149922

Files:
  clang/lib/AST/ASTContext.cpp


Index: clang/lib/AST/ASTContext.cpp
===================================================================
--- clang/lib/AST/ASTContext.cpp
+++ clang/lib/AST/ASTContext.cpp
@@ -2859,8 +2859,7 @@
   if (Ty->isPointerType())
     return true;
 
-  if (Ty->isMemberPointerType()) {
-    const auto *MPT = Ty->getAs<MemberPointerType>();
+  if (const auto *MPT = Ty->getAs<MemberPointerType>()) {
     return !ABI->getMemberPointerInfo(MPT).HasPadding;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149922.519859.patch
Type: text/x-patch
Size: 453 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230505/65ab5f9f/attachment.bin>


More information about the cfe-commits mailing list