From f0ba1d3ecb502a199f88190fa109552c2ea6a134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Mon, 4 Jan 2016 10:35:45 +0100 Subject: [PATCH] ffi: fix bug in si_make_foreign_data_from_array Use ECL_ARRAYP instead of testing for a specific types of array. It's worth to keep in mind, that STRING will be an array of integers, while BASE-STRING will be an array of the ordinary chars. Fixes #142. --- src/c/ffi.d | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/c/ffi.d b/src/c/ffi.d index 3212b878e..8861303e6 100644 --- a/src/c/ffi.d +++ b/src/c/ffi.d @@ -282,10 +282,9 @@ cl_object si_make_foreign_data_from_array(cl_object array) { cl_object tag; - if (ecl_unlikely(ecl_t_of(array) != t_array && ecl_t_of(array) != t_vector)) { - FEwrong_type_only_arg(@[si::make-foreign-data-from-array], array, - @[array]); - } + if (!ECL_ARRAYP (array)) + FEwrong_type_only_arg(@[si::make-foreign-data-from-array], + array, @[array]); tag = ecl_aet_to_ffi_table[array->array.elttype]; if (ecl_unlikely(Null(tag))) { FEerror("Cannot make foreign object from array "