aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Bishop <sam@bishop.dhs.org>2008-03-21 07:13:02 +0000
committerSam Bishop <sam@bishop.dhs.org>2008-03-21 07:13:02 +0000
commit9a4939f7edb5dc40b20865edbd4ddd830450423d (patch)
treea76ad0d3fcfc97ec29e8fe35e97f0d822a21d963
parentd8b28d78d63569a7cc4c0aed498ab2bb51310be5 (diff)
Plug a memory leak in the "this macro expands into a single trivially-
expanded token" case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48637 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Lex/PPMacroExpansion.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp
index c21f399e63..23dfbbca57 100644
--- a/lib/Lex/PPMacroExpansion.cpp
+++ b/lib/Lex/PPMacroExpansion.cpp
@@ -221,7 +221,10 @@ bool Preprocessor::HandleMacroExpandedIdentifier(Token &Identifier,
// Otherwise, if this macro expands into a single trivially-expanded
// token: expand it now. This handles common cases like
// "#define VAL 42".
-
+
+ // No need for arg info.
+ if (Args) Args->destroy();
+
// Propagate the isAtStartOfLine/hasLeadingSpace markers of the macro
// identifier to the expanded token.
bool isAtStartOfLine = Identifier.isAtStartOfLine();