From: Eli Friedman Date: Fri, 30 May 2008 11:28:30 +0000 (+0000) Subject: Fix crash with -serialize (reported to cfe-dev). The issue was X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b5239339d3b42c20a2cbb0843445ed98e1fea2b;p=clang Fix crash with -serialize (reported to cfe-dev). The issue was essentially that we were destroying the declarations twice. (Note that we don't use -serialize directly in the testsuite, only SerializeTest.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51768 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Driver/ASTConsumers.cpp b/Driver/ASTConsumers.cpp index 3383dd38fd..ba9fc90f03 100644 --- a/Driver/ASTConsumers.cpp +++ b/Driver/ASTConsumers.cpp @@ -879,6 +879,7 @@ public: virtual void Initialize(ASTContext &Context) { if (!TU) TU = new TranslationUnit(Context, lang); + TU->SetOwnsDecls(false); } virtual void HandleTopLevelDecl(Decl *D) {