diff options
author | Sam Bishop <sam@bishop.dhs.org> | 2008-03-21 07:13:02 +0000 |
---|---|---|
committer | Sam Bishop <sam@bishop.dhs.org> | 2008-03-21 07:13:02 +0000 |
commit | 9a4939f7edb5dc40b20865edbd4ddd830450423d (patch) | |
tree | a76ad0d3fcfc97ec29e8fe35e97f0d822a21d963 | |
parent | d8b28d78d63569a7cc4c0aed498ab2bb51310be5 (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.cpp | 5 |
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(); |