diff options
author | Elizabeth Andrews <elizabeth.andrews@intel.com> | 2023-08-14 08:19:12 -0700 |
---|---|---|
committer | Elizabeth Andrews <elizabeth.andrews@intel.com> | 2023-08-14 13:07:24 -0700 |
commit | c70dab026d377736c1281d3c8005bb5e578ec8b3 (patch) | |
tree | 287c5915ea94191b59f6aaf0d41f760f02126135 /clang/lib | |
parent | 6299650f9788c8b6cc784dbf8fe4086b552be2f1 (diff) | |
download | llvm-c70dab026d377736c1281d3c8005bb5e578ec8b3.zip llvm-c70dab026d377736c1281d3c8005bb5e578ec8b3.tar.gz llvm-c70dab026d377736c1281d3c8005bb5e578ec8b3.tar.bz2 |
[NFC][Clang] Fix static analyzer concern about null value dereference
Differential Revision: https://reviews.llvm.org/D157885
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Serialization/ASTReaderDecl.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index c8cbee1..15e88a9 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 |