1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-20 10:40:19 +02:00

fix bug in string array implementation type mask

* libguile/strings.c (SCM_ARRAY_IMPLEMENTATION): The mask for the string
  array implementation should be 0x7f, without masking out 0x2.
  Otherwise numbers were being thought to be vectors!

* test-suite/tests/unif.test: Add test.

* libguile/vectors.c (SCM_ARRAY_IMPLEMENTATION): Only register one
  implementation, because weak vectors can be checked with the mask &
  ~2, and the functions are the same.
This commit is contained in:
Andy Wingo 2009-12-29 12:35:13 +01:00
parent a1dcb961a6
commit c5f171027d
3 changed files with 10 additions and 4 deletions

View file

@ -1891,7 +1891,7 @@ string_get_handle (SCM v, scm_t_array_handle *h)
h->elements = h->writable_elements = NULL;
}
SCM_ARRAY_IMPLEMENTATION (scm_tc7_string, 0x7f & ~2,
SCM_ARRAY_IMPLEMENTATION (scm_tc7_string, 0x7f,
string_handle_ref, string_handle_set,
string_get_handle)
SCM_VECTOR_IMPLEMENTATION (SCM_ARRAY_ELEMENT_TYPE_CHAR, scm_make_string)