Author: Samira Bakon
Date: 2025-09-09T14:12:39-04:00
New Revision: b0c713d5851dcb5dd5002ea15793947e17b4ae1f

URL: 
https://github.com/llvm/llvm-project/commit/b0c713d5851dcb5dd5002ea15793947e17b4ae1f
DIFF: 
https://github.com/llvm/llvm-project/commit/b0c713d5851dcb5dd5002ea15793947e17b4ae1f.diff

LOG: Add null checks

Added: 
    

Modified: 
    clang/lib/Analysis/FlowSensitive/RecordOps.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Analysis/FlowSensitive/RecordOps.cpp 
b/clang/lib/Analysis/FlowSensitive/RecordOps.cpp
index 71b2aa9ff2ec4..ed827ac2c7c90 100644
--- a/clang/lib/Analysis/FlowSensitive/RecordOps.cpp
+++ b/clang/lib/Analysis/FlowSensitive/RecordOps.cpp
@@ -84,7 +84,8 @@ void copyRecord(RecordStorageLocation &Src, 
RecordStorageLocation &Dst,
     for (const auto &[Name, DstFieldLoc] : Dst.synthetic_fields())
       copySyntheticField(DstFieldLoc->getType(), Src.getSyntheticField(Name),
                          *DstFieldLoc, Env);
-  } else if (DstDecl->isDerivedFrom(SrcDecl)) {
+  } else if (SrcDecl != nullptr && DstDecl != nullptr &&
+             DstDecl->isDerivedFrom(SrcDecl)) {
     for (auto [Field, SrcFieldLoc] : Src.children())
       copyField(*Field, SrcFieldLoc, Dst.getChild(*Field), Dst, Env);
     for (const auto &[Name, SrcFieldLoc] : Src.synthetic_fields())


        
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to