From: Simon Marlow Date: Thu, 24 Jun 2010 10:46:54 +0000 (+0000) Subject: Fix an arithmetic overflow bug causing crashes with multi-GB heaps X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=bdbb7f57adf98d4826e0c97b5eff9c45ceb3dbf2;p=ghc-hetmet.git Fix an arithmetic overflow bug causing crashes with multi-GB heaps --- diff --git a/rts/sm/BlockAlloc.c b/rts/sm/BlockAlloc.c index 68c3330..9d92c6b 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);