From 7ff07727b540dfb17b5a41c95306c91e1e04ce2c Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 3 May 2014 10:39:05 +0000 Subject: [leaks] The PDFileEntry nodes in the FilesMade FoldingSet contain a std::vector that allocates on the heap. As a consequence, we have to run all of their destructors when tearing down the set, not just deallocate the memory blobs. llvm-svn: 207902 --- clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/StaticAnalyzer/Core') diff --git a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp index 89e43091753..5b2aa353651 100644 --- a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp +++ b/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp @@ -451,6 +451,11 @@ void PathDiagnosticConsumer::FlushDiagnostics( Diags.clear(); } +PathDiagnosticConsumer::FilesMade::~FilesMade() { + for (PDFileEntry &Entry : *this) + Entry.~PDFileEntry(); +} + void PathDiagnosticConsumer::FilesMade::addDiagnostic(const PathDiagnostic &PD, StringRef ConsumerName, StringRef FileName) { -- cgit v1.2.3