From: sewardj Date: Thu, 8 Feb 2001 18:04:49 +0000 (+0000) Subject: [project @ 2001-02-08 18:04:49 by sewardj] X-Git-Tag: Approximately_9120_patches~2705 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=928f485230c39f3feaeb75a3534a6c411063c9e0;p=ghc-hetmet.git [project @ 2001-02-08 18:04:49 by sewardj] fix a nasty bug in some DEBUG code which caused very occasional heap corruption. --- diff --git a/ghc/rts/GC.c b/ghc/rts/GC.c index 8790e6e..4408e2d 100644 --- a/ghc/rts/GC.c +++ b/ghc/rts/GC.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: GC.c,v 1.94 2001/01/31 11:03:21 simonmar Exp $ + * $Id: GC.c,v 1.95 2001/02/08 18:04:49 sewardj Exp $ * * (c) The GHC Team 1998-1999 * @@ -3374,8 +3374,14 @@ threadSqueezeStack(StgTSO *tso) { StgInfoTable *info = get_itbl(bh); nat np = info->layout.payload.ptrs, nw = info->layout.payload.nptrs, i; - for (i = np; i < np + nw; i++) { + /* don't zero out slop for a THUNK_SELECTOR, because it's layout + * info is used for a different purpose, and it's exactly the + * same size as a BLACKHOLE in any case. + */ + if (info->type != THUNK_SELECTOR) { + for (i = np; i < np + nw; i++) { ((StgClosure *)bh)->payload[i] = 0; + } } } #endif