[PATCH] Fix leak in lib/CodeGen/CGException.cpp, PR18318

Kostya Serebryany kcc at google.com
Wed Dec 25 23:58:47 PST 2013


Hi chandlerc, dblaikie,

This fixes the leak described in http://llvm.org/bugs/show_bug.cgi?id=18318

http://llvm-reviews.chandlerc.com/D2474

Files:
  lib/CodeGen/CGException.cpp

Index: lib/CodeGen/CGException.cpp
===================================================================
--- lib/CodeGen/CGException.cpp
+++ lib/CodeGen/CGException.cpp
@@ -1244,6 +1244,8 @@
 
   // If the catch was not required, bail out now.
   if (!CatchScope.hasEHBranches()) {
+    for (unsigned I = 0; I != NumHandlers; ++I)
+      delete CatchScope.getHandler(I).Block;
     EHStack.popCatch();
     return;
   }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2474.1.patch
Type: text/x-patch
Size: 418 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131225/357a9084/attachment.bin>


More information about the cfe-commits mailing list