summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-06-24 10:46:54 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-06-24 10:46:54 +0000
commitbdbb7f57adf98d4826e0c97b5eff9c45ceb3dbf2 (patch)
treea733c0a1625fde4ad6d2b05765c8b23b070573d6 /rts
parentd4942f78fc3cce355d340b7bba0b42e4123103fa (diff)
downloadhaskell-bdbb7f57adf98d4826e0c97b5eff9c45ceb3dbf2.tar.gz
Fix an arithmetic overflow bug causing crashes with multi-GB heaps
Diffstat (limited to 'rts')
-rw-r--r--rts/sm/BlockAlloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/sm/BlockAlloc.c b/rts/sm/BlockAlloc.c
index 68c33304f6..9d92c6bee1 100644
--- a/rts/sm/BlockAlloc.c
+++ b/rts/sm/BlockAlloc.c
@@ -283,7 +283,7 @@ alloc_mega_group (nat mblocks)
if (best)
{
// we take our chunk off the end here.
- nat best_mblocks = BLOCKS_TO_MBLOCKS(best->blocks);
+ StgWord best_mblocks = BLOCKS_TO_MBLOCKS(best->blocks);
bd = FIRST_BDESCR((StgWord8*)MBLOCK_ROUND_DOWN(best) +
(best_mblocks-mblocks)*MBLOCK_SIZE);