[PATCH] D151957: [NFC][CLANG] Fix bug with dereference null return value in GetFunctionTypeForVTable()

Soumi Manna via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 2 13:28:20 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG02ce49afb9a0: [NFC][CLANG] Fix bug with dereference null return value in… (authored by Manna).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151957

Files:
  clang/lib/CodeGen/CGCall.cpp


Index: clang/lib/CodeGen/CGCall.cpp
===================================================================
--- clang/lib/CodeGen/CGCall.cpp
+++ clang/lib/CodeGen/CGCall.cpp
@@ -1751,7 +1751,7 @@
 
 llvm::Type *CodeGenTypes::GetFunctionTypeForVTable(GlobalDecl GD) {
   const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
-  const FunctionProtoType *FPT = MD->getType()->getAs<FunctionProtoType>();
+  const FunctionProtoType *FPT = MD->getType()->castAs<FunctionProtoType>();
 
   if (!isFuncTypeConvertible(FPT))
     return llvm::StructType::get(getLLVMContext());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151957.527946.patch
Type: text/x-patch
Size: 573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230602/5fac5eac/attachment.bin>


More information about the cfe-commits mailing list