Allocate subarrays of sub-array class not the super array's class Signed-off-by: Tomek Grabiec <tgrab...@gmail.com> --- vm/object.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/vm/object.c b/vm/object.c index aaf4606..f3a738f 100644 --- a/vm/object.c +++ b/vm/object.c @@ -130,8 +130,12 @@ struct vm_object *vm_object_alloc_multi_array(struct vm_class *class, for (int i = 0; i < counts[0]; ++i) elems[i] = NULL; } else { + struct vm_class *elem_class; + + elem_class = vm_class_get_array_element_class(class); + for (int i = 0; i < counts[0]; ++i) { - elems[i] = vm_object_alloc_multi_array(class, + elems[i] = vm_object_alloc_multi_array(elem_class, nr_dimensions - 1, counts + 1); } } -- 1.6.0.6 ------------------------------------------------------------------------------ _______________________________________________ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel