aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElizabeth Andrews <elizabeth.andrews@intel.com>2023-08-14 08:19:12 -0700
committerElizabeth Andrews <elizabeth.andrews@intel.com>2023-08-14 13:07:24 -0700
commitc70dab026d377736c1281d3c8005bb5e578ec8b3 (patch)
tree287c5915ea94191b59f6aaf0d41f760f02126135
parent6299650f9788c8b6cc784dbf8fe4086b552be2f1 (diff)
downloadllvm-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
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp4
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