r337862 - [Sema] Destroy tokens in DeclaratorChunk params

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 24 15:47:17 PDT 2018


Author: d0k
Date: Tue Jul 24 15:47:16 2018
New Revision: 337862

URL: http://llvm.org/viewvc/llvm-project?rev=337862&view=rev
Log:
[Sema] Destroy tokens in DeclaratorChunk params

Otherwise this leaks in some edge cases.

Modified:
    cfe/trunk/include/clang/Sema/DeclSpec.h

Modified: cfe/trunk/include/clang/Sema/DeclSpec.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/DeclSpec.h?rev=337862&r1=337861&r2=337862&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/DeclSpec.h (original)
+++ cfe/trunk/include/clang/Sema/DeclSpec.h Tue Jul 24 15:47:16 2018
@@ -1355,8 +1355,7 @@ struct DeclaratorChunk {
     }
 
     void destroy() {
-      if (DeleteParams)
-        delete[] Params;
+      freeParams();
       switch (getExceptionSpecType()) {
       default:
         break;




More information about the cfe-commits mailing list