]> granicus.if.org Git - clang/commitdiff
Fix a double-free error that can occur in rare cases where loading
authorDouglas Gregor <dgregor@apple.com>
Wed, 6 Oct 2010 21:11:08 +0000 (21:11 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 6 Oct 2010 21:11:08 +0000 (21:11 +0000)
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

lib/Frontend/ASTUnit.cpp

index 7b87d3c2687b9e3a67e10cb597a433b103ecb952..9ae38b134aeb35fb726bf6df12b71a86fb6207ca 100644 (file)
@@ -798,6 +798,7 @@ error:
     PreprocessorOpts.DisablePCHValidation = true;
     PreprocessorOpts.ImplicitPCHInclude = PriorImplicitPCHInclude;
     delete OverrideMainBuffer;
+    SavedMainFileBuffer = 0;
   }
   
   Clang.takeSourceManager();