r244671 - Add an assert to catch lexical decl deserialization bugs.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 11 14:21:20 PDT 2015


Author: rsmith
Date: Tue Aug 11 16:21:20 2015
New Revision: 244671

URL: http://llvm.org/viewvc/llvm-project?rev=244671&view=rev
Log:
Add an assert to catch lexical decl deserialization bugs.

Modified:
    cfe/trunk/lib/Serialization/ASTReader.cpp

Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=244671&r1=244670&r2=244671&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Tue Aug 11 16:21:20 2015
@@ -6240,6 +6240,7 @@ void ASTReader::FindExternalLexicalDecls
       }
 
       if (Decl *D = GetLocalDecl(*M, ID)) {
+        assert(D->getKind() == K && "wrong kind for lexical decl");
         if (!DC->isDeclInLexicalTraversal(D))
           Decls.push_back(D);
       }




More information about the cfe-commits mailing list