[project @ 2003-11-03 15:26:22 by simonpj]
[ghc-hetmet.git] / ghc / rts / GCCompact.c
index 65e0335..958a564 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: GCCompact.c,v 1.15 2003/03/24 16:18:26 simonmar Exp $
+ * $Id: GCCompact.c,v 1.17 2003/10/22 11:11:59 simonmar Exp $
  *
  * (c) The GHC Team 2001
  *
@@ -270,7 +270,7 @@ thread_stack(StgPtr p, StgPtr stack_end)
            // traverse the bitmap first
            bitmap = GET_LIVENESS(dyn);
            p      = (P_)&((StgRetDyn *)p)->payload[0];
-           size   = RET_DYN_SIZE;
+           size   = RET_DYN_BITMAP_SIZE;
            while (size > 0) {
                if ((bitmap & 1) == 0) {
                    thread(p);
@@ -281,7 +281,7 @@ thread_stack(StgPtr p, StgPtr stack_end)
            }
            
            // skip over the non-ptr words
-           p += GET_NONPTRS(dyn);
+           p += GET_NONPTRS(dyn) + RET_DYN_NONPTR_REGS_SIZE;
            
            // follow the ptr words
            for (size = GET_PTRS(dyn); size > 0; size--) {
@@ -317,8 +317,8 @@ thread_stack(StgPtr p, StgPtr stack_end)
            nat size;
            
            p++;
-           thread(p);
            bco = (StgBCO *)*p;
+           thread(p);
            p++;
            size = BCO_BITMAP_SIZE(bco);
            thread_large_bitmap(p, BCO_BITMAP(bco), size);