[commit: ghc] ghc-8.0: Fix double-free in T5644 (#12208) (eb40deb)

git at git.haskell.org git at git.haskell.org
Thu Aug 25 16:37:15 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/eb40deb73215971b5e745cc7cc454124b7ac5250/ghc

>---------------------------------------------------------------

commit eb40deb73215971b5e745cc7cc454124b7ac5250
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Mon Jun 20 13:33:13 2016 +0100

    Fix double-free in T5644 (#12208)
    
    (cherry picked from commit e7e42c838e32ef1e05daf04b0b6afb62ffc4ec97)


>---------------------------------------------------------------

eb40deb73215971b5e745cc7cc454124b7ac5250
 rts/Schedule.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rts/Schedule.c b/rts/Schedule.c
index adb1aa1..d0ab715 100644
--- a/rts/Schedule.c
+++ b/rts/Schedule.c
@@ -1862,8 +1862,6 @@ delete_threads_and_gc:
         }
         task->cap = cap;
     }
-
-    stgFree(idle_cap);
 #endif
 
     if (heap_overflow && sched_state < SCHED_INTERRUPTING) {
@@ -1892,6 +1890,8 @@ delete_threads_and_gc:
 #endif
 
 #if defined(THREADED_RTS)
+    stgFree(idle_cap);
+
     if (gc_type == SYNC_GC_SEQ) {
         // release our stash of capabilities.
         releaseAllCapabilities(n_capabilities, cap, task);



More information about the ghc-commits mailing list