summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-04-28 01:11:23 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-04-28 01:11:23 +0000
commit66f5ab26e34f19b4dcc9f06e61e8f2b50028668a (patch)
tree8f186906f780f28cff6fb354d120d99129662627 /clang/lib/Lex/Preprocessor.cpp
parent374934cb8a34c8ea64a439e628b7937cda45c188 (diff)
downloadbcm5719-llvm-66f5ab26e34f19b4dcc9f06e61e8f2b50028668a.tar.gz
bcm5719-llvm-66f5ab26e34f19b4dcc9f06e61e8f2b50028668a.zip
Fix memory leak found by asan buildbot.
llvm-svn: 235957
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 92ab2af1921..80715d54807 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -142,6 +142,9 @@ Preprocessor::Preprocessor(IntrusiveRefCntPtr<PreprocessorOptions> PPOpts,
Preprocessor::~Preprocessor() {
assert(BacktrackPositions.empty() && "EnableBacktrack/Backtrack imbalance!");
+ for (auto &Macro : Macros)
+ Macro.second.destroy();
+
IncludeMacroStack.clear();
// Destroy any macro definitions.
OpenPOWER on IntegriCloud