[PATCH] D151281: [NFC][CLANG] Fix issue with dereference null return value found by Coverity

Soumi Manna via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 24 19:17:42 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGad571e0d84b3: [NFC][CLANG] Fix issue with dereference null return value found by Coverity (authored by Manna).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151281

Files:
  clang/lib/Sema/SemaDeclCXX.cpp


Index: clang/lib/Sema/SemaDeclCXX.cpp
===================================================================
--- clang/lib/Sema/SemaDeclCXX.cpp
+++ clang/lib/Sema/SemaDeclCXX.cpp
@@ -7517,7 +7517,7 @@
     }
   }
 
-  const FunctionProtoType *Type = MD->getType()->getAs<FunctionProtoType>();
+  const FunctionProtoType *Type = MD->getType()->castAs<FunctionProtoType>();
 
   bool CanHaveConstParam = false;
   if (CSM == CXXCopyConstructor)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151281.525406.patch
Type: text/x-patch
Size: 440 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230525/7fb0f2d6/attachment.bin>


More information about the cfe-commits mailing list