fix a bug introduced in 1fb38442d3a55ac92795aa6c5ed4df82011df724,
authorSimon Marlow <marlowsd@gmail.com>
Wed, 13 Apr 2011 10:27:20 +0000 (11:27 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 13 Apr 2011 10:28:11 +0000 (11:28 +0100)
symptom was 2047(threaded2) was crashing.

rts/sm/GC.c

index d0dd44d..05bc8f2 100644 (file)
@@ -643,8 +643,12 @@ GarbageCollect (rtsBool force_major_gc,
   // zero the scavenged static object list 
   if (major_gc) {
       nat i;
-      for (i = 0; i < n_gc_threads; i++) {
-          zero_static_object_list(gc_threads[i]->scavenged_static_objects);
+      if (n_gc_threads == 1) {
+          zero_static_object_list(gct->scavenged_static_objects);
+      } else {
+          for (i = 0; i < n_gc_threads; i++) {
+              zero_static_object_list(gc_threads[i]->scavenged_static_objects);
+          }
       }
   }