summaryrefslogtreecommitdiff
path: root/rts/Threads.c
diff options
context:
space:
mode:
Diffstat (limited to 'rts/Threads.c')
-rw-r--r--rts/Threads.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/rts/Threads.c b/rts/Threads.c
index 8ee8d4f09a..af4353fc49 100644
--- a/rts/Threads.c
+++ b/rts/Threads.c
@@ -499,7 +499,8 @@ threadStackOverflow (Capability *cap, StgTSO *tso)
IF_DEBUG(sanity,checkTSO(tso));
- if (tso->tot_stack_size >= RtsFlags.GcFlags.maxStkSize) {
+ if (RtsFlags.GcFlags.maxStkSize > 0
+ && tso->tot_stack_size >= RtsFlags.GcFlags.maxStkSize) {
// #3677: In a stack overflow situation, stack squeezing may
// reduce the stack size, but we don't know whether it has been
// reduced enough for the stack check to succeed if we try