[cfe-commits] r48637 - /cfe/trunk/lib/Lex/PPMacroExpansion.cpp

Sam Bishop sam at bishop.dhs.org
Fri Mar 21 00:13:02 PDT 2008


Author: sbishop
Date: Fri Mar 21 02:13:02 2008
New Revision: 48637

URL: http://llvm.org/viewvc/llvm-project?rev=48637&view=rev
Log:
Plug a memory leak in the "this macro expands into a single trivially-
expanded token" case.

Modified:
    cfe/trunk/lib/Lex/PPMacroExpansion.cpp

Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=48637&r1=48636&r2=48637&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Fri Mar 21 02:13:02 2008
@@ -221,7 +221,10 @@
     // 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();





More information about the cfe-commits mailing list