[INTERPRETER]

* BUG: Implicit array conversion now correctly preserves dimensions.


git-svn-id: svn://localhost/gambas/trunk@5237 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2012-10-14 10:52:02 +00:00
parent 2ab47c59e0
commit fedc591dfc

View file

@ -99,7 +99,7 @@ static int get_dim(CARRAY *_object)
{
int d;
if (LIKELY(THIS->dim == NULL))
if (THIS->dim == NULL)
return 1;
else
{
@ -114,7 +114,7 @@ static int get_dim(CARRAY *_object)
static int get_bound(CARRAY *_object, int d)
{
if (LIKELY(THIS->dim == NULL))
if (THIS->dim == NULL)
return THIS->count;
else
{
@ -1407,6 +1407,7 @@ static bool _convert(CARRAY *src, CLASS *class, VALUE *conv)
int i;
void *data;
VALUE temp;
int dim;
if (!src || !TYPE_is_pure_object((TYPE)class))
return TRUE;
@ -1435,6 +1436,14 @@ static bool _convert(CARRAY *src, CLASS *class, VALUE *conv)
}
END_ERROR
dim = get_dim(src);
if (dim > 1)
{
ALLOC(&array->dim, dim * sizeof(int), "_convert");
for (i = 0; i < dim; i++)
array->dim[i] = src->dim[i];
}
conv->_object.object = array;
return FALSE;
}