[project @ 1999-02-17 17:35:31 by simonm]
authorsimonm <unknown>
Wed, 17 Feb 1999 17:35:32 +0000 (17:35 +0000)
committersimonm <unknown>
Wed, 17 Feb 1999 17:35:32 +0000 (17:35 +0000)
Fix a couple of uninitialized data reads.

ghc/rts/GC.c
ghc/rts/Storage.c

index 965ee09..c70f408 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: GC.c,v 1.35 1999/02/17 15:04:40 simonm Exp $
+ * $Id: GC.c,v 1.36 1999/02/17 17:35:32 simonm Exp $
  *
  * (c) The GHC Team 1998-1999
  *
@@ -399,6 +399,9 @@ void GarbageCollect(void (*get_roots)(void))
     loop2:
       for (gen = RtsFlags.GcFlags.generations-1; gen >= 0; gen--) {
        for (st = generations[gen].n_steps-1; st >= 0 ; st--) {
+         if (gen == 0 && step == 0) { 
+           continue; 
+         }
          step = &generations[gen].steps[st];
          evac_gen = gen;
          if (step->hp_bd != step->scan_bd || step->scan < step->hp) {
index e94094b..c309b3f 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Storage.c,v 1.12 1999/02/05 16:03:01 simonm Exp $
+ * $Id: Storage.c,v 1.13 1999/02/17 17:35:31 simonm Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -114,6 +114,8 @@ initStorage (void)
       step->hp = NULL;
       step->hpLim = NULL;
       step->hp_bd = NULL;
+      step->scan = NULL;
+      step->scan_bd = NULL;
       step->large_objects = NULL;
       step->new_large_objects = NULL;
       step->scavenged_large_objects = NULL;