fix marking of double-cell subrs
authorAndy Wingo <wingo@oblong.net>
Tue, 17 Mar 2009 15:36:20 +0000 (16:36 +0100)
committerAndy Wingo <wingo@oblong.net>
Tue, 17 Mar 2009 15:36:20 +0000 (16:36 +0100)
* libguile/gc-mark.c (scm_gc_mark_dependencies): Mark the name, generic,
  and properties of subrs.

libguile/gc-mark.c

index e73f6e1..ab629f2 100644 (file)
@@ -337,7 +337,13 @@ scm_gc_mark_dependencies (SCM p)
       ptr = SCM_CELL_OBJECT_1 (ptr);
       goto gc_mark_loop;
     case scm_tcs_subrs:
-      break;
+      if (SCM_CELL_WORD_2 (ptr) && *(SCM*)SCM_CELL_WORD_2 (ptr))
+        /* the generic associated with this primitive */
+        scm_gc_mark (*(SCM*)SCM_CELL_WORD_2 (ptr));
+      if (SCM_NIMP (((SCM*)SCM_CELL_WORD_3 (ptr))[1]))
+        scm_gc_mark (((SCM*)SCM_CELL_WORD_3 (ptr))[1]); /* props */
+      ptr = ((SCM*)SCM_CELL_WORD_3 (ptr))[0]; /* name */
+      goto gc_mark_loop;
     case scm_tc7_port:
       i = SCM_PTOBNUM (ptr);
 #if (SCM_DEBUG_CELL_ACCESSES == 1)