From 1609a6c60a7b0d110dfcd8ae048850181f686004 Mon Sep 17 00:00:00 2001 From: gambas Date: Wed, 10 Feb 2021 19:20:43 +0100 Subject: [PATCH] Fix automatic conversion of multi-dimensional arrays. [INTERPRETER] * BUG: Fix automatic conversion of multi-dimensional arrays. --- main/gbx/gbx_c_array.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/gbx/gbx_c_array.c b/main/gbx/gbx_c_array.c index 3386b4dad..a4fd96bcf 100644 --- a/main/gbx/gbx_c_array.c +++ b/main/gbx/gbx_c_array.c @@ -1932,12 +1932,13 @@ static bool _convert(CARRAY *src, CLASS *class, VALUE *conv) END_ERROR } - dim = get_dim(src); - if (dim > 1) + if (src->n_dim) { + dim = get_dim(src); ALLOC(&array->dim, dim * sizeof(int)); for (i = 0; i < dim; i++) array->dim[i] = src->dim[i]; + array->n_dim = src->n_dim; } conv->_object.object = array;