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 23a7b1358f06ff081f5afd8f68de90965f0e27b1..bcfdea8acfb164e7218f22930b004ba4d4e3df17 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 8daa8f2e49c9f13529cfe9cdd9e3540f9246c31d..8cce277b496a855861ba16e8953177129b36d706 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)
        {