Author: Timm Bäder
Date: 2024-04-22T14:39:24+02:00
New Revision: 103f1be76fbb82ef8ed95b6112d914d4996e27be

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

LOG: [clang][Interp][NFC] getRecord() might return null

Added: 
    

Modified: 
    clang/lib/AST/Interp/ByteCodeExprGen.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp 
b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
index 5b9ef9980c9cd0..d406ac332ae26d 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -1351,6 +1351,8 @@ bool ByteCodeExprGen<Emitter>::VisitMemberExpr(const 
MemberExpr *E) {
   if (const auto *FD = dyn_cast<FieldDecl>(Member)) {
     const RecordDecl *RD = FD->getParent();
     const Record *R = getRecord(RD);
+    if (!R)
+      return false;
     const Record::Field *F = R->getField(FD);
     // Leave a pointer to the field on the stack.
     if (F->Decl->getType()->isReferenceType())


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

Reply via email to