PR jit/63854: Fix leak of worklist within jit-recording.c
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 19 Nov 2014 20:10:00 +0000 (20:10 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 19 Nov 2014 20:10:00 +0000 (20:10 +0000)
gcc/jit/ChangeLog:
PR jit/63854
* jit-recording.c (recording::function::validate): Convert
"worklist" from vec<> to autovec<> to fix a leak.

From-SVN: r217802

gcc/jit/ChangeLog
gcc/jit/jit-recording.c

index 23a7b13..bcfdea8 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-19  David Malcolm  <dmalcolm@redhat.com>
+
+       PR jit/63854
+       * jit-recording.c (recording::function::validate): Convert
+       "worklist" from vec<> to autovec<> to fix a leak.
+
 2014-11-11  David Malcolm  <dmalcolm@redhat.com>
 
        * ChangeLog.jit: New.
index 8daa8f2..8cce277 100644 (file)
@@ -2187,8 +2187,7 @@ recording::function::validate ()
     {
       /* Iteratively walk the graph of blocks, marking their "m_is_reachable"
         flag, starting at the initial block.  */
-      vec<block *> worklist;
-      worklist.create (m_blocks.length ());
+      auto_vec<block *> worklist (m_blocks.length ());
       worklist.safe_push (m_blocks[0]);
       while (worklist.length () > 0)
        {