From 27654983dc1b42531fa63156af84e5184a72df78 Mon Sep 17 00:00:00 2001 From: Sam Bishop Date: Fri, 21 Mar 2008 07:13:02 +0000 Subject: [PATCH] Plug a memory leak in the "this macro expands into a single trivially- expanded token" case. llvm-svn: 48637 --- clang/lib/Lex/PPMacroExpansion.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index c21f399e63d6..23dfbbca578f 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/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();