From: simonmar Date: Fri, 19 Apr 2002 10:23:43 +0000 (+0000) Subject: [project @ 2002-04-19 10:23:43 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~2139 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=54d7230a6f4a42ca323a1b38d9c91913470a3a51;p=ghc-hetmet.git [project @ 2002-04-19 10:23:43 by simonmar] Skip over DEAD_WEAK objects when starting finalizers. --- diff --git a/ghc/rts/Weak.c b/ghc/rts/Weak.c index 5c71710..7416ef8 100644 --- a/ghc/rts/Weak.c +++ b/ghc/rts/Weak.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Weak.c,v 1.21 2002/02/18 13:26:13 sof Exp $ + * $Id: Weak.c,v 1.22 2002/04/19 10:23:43 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -70,7 +70,8 @@ scheduleFinalizers(StgWeak *list) /* count number of finalizers first... */ for (n = 0, w = list; w; w = w->link) { - if (w->finalizer != &stg_NO_FINALIZER_closure) + if (w->header.info != &stg_DEAD_WEAK_info && + w->finalizer != &stg_NO_FINALIZER_closure) n++; } @@ -83,7 +84,8 @@ scheduleFinalizers(StgWeak *list) arr->ptrs = n; for (n = 0, w = list; w; w = w->link) { - if (w->finalizer != &stg_NO_FINALIZER_closure) { + if (w->header.info != &stg_DEAD_WEAK_info && + w->finalizer != &stg_NO_FINALIZER_closure) { arr->payload[n] = w->finalizer; n++; }