[Sema] Destroy tokens in DeclaratorChunk params
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 24 Jul 2018 22:47:16 +0000 (22:47 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 24 Jul 2018 22:47:16 +0000 (22:47 +0000)
Otherwise this leaks in some edge cases.

llvm-svn: 337862

clang/include/clang/Sema/DeclSpec.h

index 40e5269..83d5ab2 100644 (file)
@@ -1355,8 +1355,7 @@ struct DeclaratorChunk {
     }
 
     void destroy() {
-      if (DeleteParams)
-        delete[] Params;
+      freeParams();
       switch (getExceptionSpecType()) {
       default:
         break;