From: Douglas Gregor Date: Wed, 6 Oct 2010 21:11:08 +0000 (+0000) Subject: Fix a double-free error that can occur in rare cases where loading X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=37cf66350cb5a2bb68b0b7c7cca552f7a4867348;p=clang Fix a double-free error that can occur in rare cases where loading of the precompiled preamble (or any PCH file it depends on) fails during reparsing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115838 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 7b87d3c268..9ae38b134a 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -798,6 +798,7 @@ error: PreprocessorOpts.DisablePCHValidation = true; PreprocessorOpts.ImplicitPCHInclude = PriorImplicitPCHInclude; delete OverrideMainBuffer; + SavedMainFileBuffer = 0; } Clang.takeSourceManager();