diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 4b3b975cb..1f7b246a2 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,8 @@ +2000-06-15 Dirk Herrmann + + * gc.c (scm_unprotect_object): The reference count is guaranteed + to be a positive number. + 2000-06-15 Mikael Djurfeldt * eval.c: Updated comment above scm_map. diff --git a/libguile/gc.c b/libguile/gc.c index fc5dd4516..3da2065cd 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -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;