[clang] 751f1bf - [clang][Interp][NFC] Assert we have a valid Record instance

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 25 23:55:34 PDT 2022


Author: Timm Bäder
Date: 2022-10-26T08:49:31+02:00
New Revision: 751f1bfb5f77dfab27456c6964721ed3a4f9f896

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

LOG: [clang][Interp][NFC] Assert we have a valid Record instance

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/ByteCodeStmtGen.cpp b/clang/lib/AST/Interp/ByteCodeStmtGen.cpp
index 4f54193dcf3a..bdb072c3b0aa 100644
--- a/clang/lib/AST/Interp/ByteCodeStmtGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeStmtGen.cpp
@@ -98,6 +98,7 @@ bool ByteCodeStmtGen<Emitter>::visitFunc(const FunctionDecl *F) {
   if (const auto Ctor = dyn_cast<CXXConstructorDecl>(F)) {
     const RecordDecl *RD = Ctor->getParent();
     const Record *R = this->getRecord(RD);
+    assert(R);
 
     for (const auto *Init : Ctor->inits()) {
       const Expr *InitExpr = Init->getInit();


        


More information about the cfe-commits mailing list