* The reference count in scm_unprotect_object is always positive.
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>
Thu, 15 Jun 2000 08:35:42 +0000 (08:35 +0000)
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>
Thu, 15 Jun 2000 08:35:42 +0000 (08:35 +0000)
libguile/ChangeLog
libguile/gc.c

index 4b3b975..1f7b246 100644 (file)
@@ -1,3 +1,8 @@
+2000-06-15  Dirk Herrmann  <D.Herrmann@tu-bs.de>
+
+       * gc.c (scm_unprotect_object):  The reference count is guaranteed
+       to be a positive number.
+
 2000-06-15  Mikael Djurfeldt  <mdj@thalamus.nada.kth.se>
 
        * eval.c: Updated comment above scm_map.
index fc5dd45..3da2065 100644 (file)
@@ -2173,14 +2173,14 @@ scm_unprotect_object (SCM obj)
       fprintf (stderr, "scm_unprotect_object called on unprotected object\n");
       abort ();
     }
-  
-  {
-    int count = SCM_INUM (SCM_CDR (handle)) - 1;
-    if (count <= 0)
-      scm_hashq_remove_x (scm_protects, obj);
-    else
-      SCM_SETCDR (handle, SCM_MAKINUM (count));
-  }
+  else
+    {
+      unsigned long int count = SCM_INUM (SCM_CDR (handle)) - 1;
+      if (count == 0)
+       scm_hashq_remove_x (scm_protects, obj);
+      else
+       SCM_SETCDR (handle, SCM_MAKINUM (count));
+    }
 
   SCM_REALLOW_INTS;