Skip to content
Snippets Groups Projects
Commit 4e9a8fa4 authored by Simon Marlow's avatar Simon Marlow
Browse files

[project @ 2000-11-07 18:00:26 by simonmar]

URK!  when scanning the heap we might find a DEAD_WEAK that either (a)
is the size of a WEAK, because we just overwrote its info table, or
(b) is the size of a DEAD_WEAK, because its been around at least one
GC.  The code herein only accounted for case (a).

Fix: check the word at location p+sizeof(DEAD_WEAK), see whether it
looks like an info table ptr, and if so we're in case (b).  This is
guaranteed to work, because we know that in case (a) the appropriate
word will be a closure pointer.
parent 2de8104d
No related merge requests found
/* -----------------------------------------------------------------------------
* $Id: ProfHeap.c,v 1.16 2000/07/09 16:17:10 panne Exp $
* $Id: ProfHeap.c,v 1.17 2000/11/07 18:00:26 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
......@@ -496,9 +496,10 @@ heapCensus(void)
break;
case CONSTR:
if (((StgClosure *)p)->header.info == &DEAD_WEAK_info) {
size = sizeofW(StgWeak);
break;
if (((StgClosure *)p)->header.info == &DEAD_WEAK_info
&& !(LOOKS_LIKE_GHC_INFO(*(p + sizeW_fromITBL(info))))) {
size = sizeofW(StgWeak);
break;
}
/* else, fall through... */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment