PR jit/63854: Fix leak of paths within jump threading
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 19 Nov 2014 20:17:44 +0000 (20:17 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 19 Nov 2014 20:17:44 +0000 (20:17 +0000)
gcc/ChangeLog:
PR jit/63854
* tree-ssa-threadedge.c (thread_across_edge): Don't just release
"path", delete it.
* tree-ssa-threadupdate.c (delete_jump_thread_path): Likewise.

From-SVN: r217804

gcc/ChangeLog
gcc/tree-ssa-threadedge.c
gcc/tree-ssa-threadupdate.c

index 9c9bd0139e04de29f68e2e5226dba563187daec7..9cb1ebd9d4587ccb2986c8d3997419a6872909ad 100644 (file)
@@ -1,3 +1,10 @@
+2014-11-19  David Malcolm  <dmalcolm@redhat.com>
+
+       PR jit/63854
+       * tree-ssa-threadedge.c (thread_across_edge): Don't just release
+       "path", delete it.
+       * tree-ssa-threadupdate.c (delete_jump_thread_path): Likewise.
+
 2014-11-19  David Malcolm  <dmalcolm@redhat.com>
 
        PR jit/63854
index 486940a30949b5ce838f3947afb0dbaf63f19b9e..8b0b7b801a1c3c4f0606100bec60ca52f36027be 100644 (file)
@@ -1150,6 +1150,7 @@ thread_across_edge (gcond *dummy_cond,
         through the vector entries.  */
       gcc_assert (path->length () == 0);
       path->release ();
+      delete path;
 
       /* A negative status indicates the target block was deemed too big to
         duplicate.  Just quit now rather than trying to use the block as
index 97748cb66a397d06e63efb16551c0cf1fd4cf566..ca0b8bfdd4bcc37851ba7d2f48d65255aa713ac5 100644 (file)
@@ -2481,6 +2481,7 @@ delete_jump_thread_path (vec<jump_thread_edge *> *path)
   for (unsigned int i = 0; i < path->length (); i++)
     delete (*path)[i];
   path->release();
+  delete path;
 }
 
 /* Register a jump threading opportunity.  We queue up all the jump