From 928f485230c39f3feaeb75a3534a6c411063c9e0 Mon Sep 17 00:00:00 2001 From: sewardj Date: Thu, 8 Feb 2001 18:04:49 +0000 Subject: [PATCH 1/1] [project @ 2001-02-08 18:04:49 by sewardj] fix a nasty bug in some DEBUG code which caused very occasional heap corruption. --- ghc/rts/GC.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 -- 1.7.10.4