In 1.8 there seems to be something a bit evil in array-set! on a bit
vector created by make-uniform-vector,

        guile> (define a (make-uniform-vector 15 #t #t))
        guile> a
        #*111111111111111
        guile> (array-set! a #f 0)
        guile> a
        (2207 . #<smob 80ba960>)

I don't understand all that stuff, but I got some joy from this
change.  Can someone (Marius?) confirm or deny?

        * unif.c (bitvector_set): Should be h->writable_elements not
        h->elements, the latter results in a segv in array-set! on a bit
        vector.

--- unif.c.~1.192.2.2.~ 2006-02-14 08:59:03.000000000 +1100
+++ unif.c      2006-02-25 18:22:35.000000000 +1100
@@ -380,9 +380,9 @@
   pos += scm_array_handle_bit_elements_offset (h);
   mask = 1l << (pos % 32);
   if (scm_to_bool (val))
-    ((scm_t_uint32 *)h->elements)[pos/32] |= mask;
+    ((scm_t_uint32 *)h->writable_elements)[pos/32] |= mask;
   else
-    ((scm_t_uint32 *)h->elements)[pos/32] &= ~mask;
+    ((scm_t_uint32 *)h->writable_elements)[pos/32] &= ~mask;
 }
 
 static void
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel

Reply via email to