summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2014-11-17 13:03:56 +0000
committerSimon Marlow <marlowsd@gmail.com>2014-11-17 13:03:56 +0000
commit2a6f193bb82f88e8dcb919ee7affc13feae56e98 (patch)
treeff36315687ad03528bc4ab66eabd6bf1f37f485f /rts
parenta2c0a8dd15de2023e17078fa5f421ba581b3a5fa (diff)
downloadhaskell-2a6f193bb82f88e8dcb919ee7affc13feae56e98.tar.gz
Fix a bug introduced with allocation counters
Diffstat (limited to 'rts')
-rw-r--r--rts/Schedule.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c
index c2260f0282..e9b0289599 100644
--- a/rts/Schedule.c
+++ b/rts/Schedule.c
@@ -2233,6 +2233,9 @@ suspendThread (StgRegTable *reg, rtsBool interruptible)
task->incall->suspended_tso = tso;
task->incall->suspended_cap = cap;
+ // Otherwise allocate() will write to invalid memory.
+ cap->r.rCurrentTSO = NULL
+
ACQUIRE_LOCK(&cap->lock);
suspendTask(cap,task);