bug fixes checked in
[IRC.git] / Robust / src / Runtime / garbage.c
index e2b688b320f4fd93d233c0cca373a623e61c3c08..7ead1fb476bd599c01debd1da5339f8ee4b7d3d9 100644 (file)
@@ -319,6 +319,9 @@ void collect(struct garbagelist * stackptr) {
 }
 
 #ifdef TASK
+
+/* Fix up the references from tags.  This can't be done earlier,
+   because we don't want tags to keep objects alive */
 void fixtags() {
   while(taghead!=NULL) {
     int i;
@@ -327,7 +330,9 @@ void fixtags() {
       struct ___TagDescriptor___ *tagd=taghead->ptrs[i];
       struct ___Object___ *obj=tagd->flagptr;
       struct ___TagDescriptor___ *copy=((struct ___TagDescriptor___**)tagd)[1];
-      if (obj->type==-1) {
+      if (obj==NULL) {
+       /* Zero object case */
+      } else if (obj->type==-1) {
        /* Single object case */
        copy->flagptr=((struct ___Object___**)obj)[1];
       } else if (obj->type==OBJECTARRAYTYPE) {