forked from OSchip/llvm-project
4a8212a488
This reverts commit r236422, effectively reapplying r236419. ASan helped me diagnose the problem: the non-leaking logic would free the ASTConsumer before freeing Sema whenever `isCurrentASTFile()`, causing a use-after-free in `Sema::~Sema()`. This version unconditionally frees Sema and the ASTContext before freeing the ASTConsumer. Without the fix, these were either being freed before the ASTConsumer was freed or leaked after, but they were always spiritually released so this isn't really a functionality change. I ran all of check-clang with ASan locally this time, so I'm hoping there aren't any more problems lurking. Original commit message: Try again to plug a leak that's been around since at least r128011 after coming across the FIXME. Nico Weber tried something similar in r207065 but had to revert in r207070 due to a bot failure. The build failure isn't visible anymore so I'm not sure what went wrong. I'm doing this slightly differently -- when not -disable-free I'm still resetting the members (just not leaking them) -- so maybe it will work out this time? Tests pass locally, anyway. llvm-svn: 236424 |
||
---|---|---|
.. | ||
Rewrite | ||
ASTConsumers.cpp | ||
ASTMerge.cpp | ||
ASTUnit.cpp | ||
CMakeLists.txt | ||
CacheTokens.cpp | ||
ChainedDiagnosticConsumer.cpp | ||
ChainedIncludesSource.cpp | ||
CodeGenOptions.cpp | ||
CompilerInstance.cpp | ||
CompilerInvocation.cpp | ||
CreateInvocationFromCommandLine.cpp | ||
DependencyFile.cpp | ||
DependencyGraph.cpp | ||
DiagnosticRenderer.cpp | ||
FrontendAction.cpp | ||
FrontendActions.cpp | ||
FrontendOptions.cpp | ||
HeaderIncludeGen.cpp | ||
InitHeaderSearch.cpp | ||
InitPreprocessor.cpp | ||
LangStandards.cpp | ||
LayoutOverrideSource.cpp | ||
LogDiagnosticPrinter.cpp | ||
Makefile | ||
ModuleDependencyCollector.cpp | ||
MultiplexConsumer.cpp | ||
PrintPreprocessedOutput.cpp | ||
SerializedDiagnosticPrinter.cpp | ||
SerializedDiagnosticReader.cpp | ||
TextDiagnostic.cpp | ||
TextDiagnosticBuffer.cpp | ||
TextDiagnosticPrinter.cpp | ||
VerifyDiagnosticConsumer.cpp |