* gc-card.c (scm_i_card_statistics): init tag.
authorHan-Wen Nienhuys <hanwen@lilypond.org>
Fri, 1 Jul 2005 12:34:58 +0000 (12:34 +0000)
committerHan-Wen Nienhuys <hanwen@lilypond.org>
Fri, 1 Jul 2005 12:34:58 +0000 (12:34 +0000)
* gc.c (tag_table_to_type_alist): check type of tag. Should be integer.

libguile/ChangeLog
libguile/gc-card.c
libguile/gc.c

index 24bc5ca..67f061a 100644 (file)
@@ -1,6 +1,13 @@
+2005-07-01  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * gc-card.c (scm_i_card_statistics): init tag.
+
+       * gc.c (tag_table_to_type_alist): check type of tag. Should be integer.
+
 2005-06-18  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
-       * fports.c (s_scm_open_file): add the b flag for binary to the doc string.
+       * fports.c (s_scm_open_file): add the b flag for binary to the doc
+       string.
 
 2005-06-25  Kevin Ryde  <user42@zip.com.au>
 
index 21ece54..3fd8a30 100644 (file)
@@ -308,7 +308,7 @@ scm_i_card_statistics (scm_t_cell *p, SCM hashtab, scm_t_heap_segment *seg)
 
   for (p += offset; p < end; p += span, offset += span)
     {
-      scm_t_bits tag;
+      scm_t_bits tag = -1;
       SCM scmptr = PTR2SCM (p);
 
       if (!SCM_C_BVEC_GET (bitvec, offset))
index b926911..382022c 100644 (file)
@@ -262,19 +262,23 @@ unsigned scm_newcell2_count;
 static SCM
 tag_table_to_type_alist (void *closure, SCM key, SCM val, SCM acc)
 {
-  scm_t_bits c_tag = scm_to_int (key);
-
-  char const * name = scm_i_tag_name (c_tag);
-  if (name != NULL)
-    {
-      key = scm_from_locale_string (name);
-    }
-  else
+  if (scm_is_integer (key))
     {
-      char s[100];
-      sprintf (s, "tag %d", c_tag);
-      key = scm_from_locale_string (s);
+      scm_t_bits c_tag = scm_to_int (key);
+
+      char const * name = scm_i_tag_name (c_tag);
+      if (name != NULL)
+       {
+         key = scm_from_locale_string (name);
+       }
+      else
+       {
+         char s[100];
+         sprintf (s, "tag %d", c_tag);
+         key = scm_from_locale_string (s);
+       }
     }
+  
   return scm_cons (scm_cons (key, val), acc);
 }