diff options
author | simonmar <unknown> | 2002-10-25 09:40:47 +0000 |
---|---|---|
committer | simonmar <unknown> | 2002-10-25 09:40:47 +0000 |
commit | 67944e157c667338e206f0cca6c48319ebc256d0 (patch) | |
tree | d5897975c9889aed053133b1207fa48358f70d02 | |
parent | 1dafd8c2d6e1d1d556a944032d9ccad7206a6dc1 (diff) | |
download | haskell-67944e157c667338e206f0cca6c48319ebc256d0.tar.gz |
[project @ 2002-10-25 09:40:47 by simonmar]
In eval_thunk_selector(), don't follow IND_STATICs because they might
lead us into to-space. Fixes a case of "EVACUATED object entered!".
Also, add an assertion to catch this bug earlier.
MERGE TO STABLE
-rw-r--r-- | ghc/rts/GC.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ghc/rts/GC.c b/ghc/rts/GC.c index 853d5489c6..9ed6f64629 100644 --- a/ghc/rts/GC.c +++ b/ghc/rts/GC.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: GC.c,v 1.144 2002/09/25 14:46:34 simonmar Exp $ + * $Id: GC.c,v 1.145 2002/10/25 09:40:47 simonmar Exp $ * * (c) The GHC Team 1998-1999 * @@ -1382,8 +1382,12 @@ addBlock(step *stp) static __inline__ void upd_evacuee(StgClosure *p, StgClosure *dest) { - p->header.info = &stg_EVACUATED_info; - ((StgEvacuated *)p)->evacuee = dest; + // Source object must be in from-space: + ASSERT((Bdescr((P_)p)->flags & BF_EVACUATED) == 0); + // not true: (ToDo: perhaps it should be) + // ASSERT(Bdescr((P_)dest)->flags & BF_EVACUATED); + p->header.info = &stg_EVACUATED_info; + ((StgEvacuated *)p)->evacuee = dest; } @@ -1985,7 +1989,6 @@ selector_loop: return selectee->payload[field]; case IND: - case IND_STATIC: case IND_PERM: case IND_OLDGEN: case IND_OLDGEN_PERM: @@ -1998,6 +2001,11 @@ selector_loop: // leaks by evaluating this selector thunk anyhow. break; + case IND_STATIC: + // We can't easily tell whether the indirectee is into + // from or to-space, so just bail out here. + break; + case THUNK_SELECTOR: { StgClosure *val; |