summaryrefslogtreecommitdiff
path: root/rts/Threads.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-04-12 11:41:17 +0100
committerSimon Marlow <marlowsd@gmail.com>2012-04-12 13:40:53 +0100
commit5eabdc1675b8b5bc9fcdfb96ab63d14d42ca2d5b (patch)
tree73cf808ef6ba7c26667c8b846fab3a1bdf21a68f /rts/Threads.c
parent392c2886dcd14e4aa57440b8169ba427f5a93c8b (diff)
downloadhaskell-5eabdc1675b8b5bc9fcdfb96ab63d14d42ca2d5b.tar.gz
Fix crash with tiny initial stack size (#5993)
Diffstat (limited to 'rts/Threads.c')
-rw-r--r--rts/Threads.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/Threads.c b/rts/Threads.c
index 997bcc8882..61bf4445e8 100644
--- a/rts/Threads.c
+++ b/rts/Threads.c
@@ -66,8 +66,8 @@ createThread(Capability *cap, nat size)
/* sched_mutex is *not* required */
/* catch ridiculously small stack sizes */
- if (size < MIN_STACK_WORDS + sizeofW(StgStack)) {
- size = MIN_STACK_WORDS + sizeofW(StgStack);
+ if (size < MIN_STACK_WORDS + sizeofW(StgStack) + sizeofW(StgTSO)) {
+ size = MIN_STACK_WORDS + sizeofW(StgStack) + sizeofW(StgTSO);
}
/* The size argument we are given includes all the per-thread