Author: Elizabeth Andrews Date: 2023-08-14T13:07:24-07:00 New Revision: c70dab026d377736c1281d3c8005bb5e578ec8b3
URL: https://github.com/llvm/llvm-project/commit/c70dab026d377736c1281d3c8005bb5e578ec8b3 DIFF: https://github.com/llvm/llvm-project/commit/c70dab026d377736c1281d3c8005bb5e578ec8b3.diff LOG: [NFC][Clang] Fix static analyzer concern about null value dereference Differential Revision: https://reviews.llvm.org/D157885 Added: Modified: clang/lib/Serialization/ASTReaderDecl.cpp Removed: ################################################################################ diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index c8cbee14be4f02..15e88a9be44ad0 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -4459,7 +4459,9 @@ void ASTDeclReader::UpdateDecl(Decl *D, if (auto *VTSD = dyn_cast<VarTemplateSpecializationDecl>(D)) { VTSD->setPointOfInstantiation(POI); } else if (auto *VD = dyn_cast<VarDecl>(D)) { - VD->getMemberSpecializationInfo()->setPointOfInstantiation(POI); + MemberSpecializationInfo *MSInfo = VD->getMemberSpecializationInfo(); + assert(MSInfo && "No member specialization information"); + MSInfo->setPointOfInstantiation(POI); } else { auto *FD = cast<FunctionDecl>(D); if (auto *FTSInfo = FD->TemplateOrSpecialization _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits