2002-04-21 Dan Lewis <dihlewis@yahoo.co.uk>
authorDan Lewis <dan@mono-cvs.ximian.com>
Mon, 22 Apr 2002 12:00:26 +0000 (12:00 -0000)
committerDan Lewis <dan@mono-cvs.ximian.com>
Mon, 22 Apr 2002 12:00:26 +0000 (12:00 -0000)
* object.c: mono_array_new_full workaround mono_array_class_get
problem.

svn path=/trunk/mono/; revision=3961

mono/metadata/ChangeLog
mono/metadata/class.c
mono/metadata/object.c

index 2c6358065f6393459ca9b9cb66abba2a8897994f..dcbe10c27de4b83f427107def59bd4dcea83aa14 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-21  Dan Lewis  <dihlewis@yahoo.co.uk>
+
+       * object.c: mono_array_new_full workaround mono_array_class_get
+       problem.
+
 2002-04-17     Patrik Torstensson <patrik.torstensson@labs2.com>
 
        * string-icalls.c (mono_string_InternalRemove): Fixed overwrite bug.
index 4ccc31e52637201fa7111b7b82c0383f82329bf7..106c8522ca7ca0d28af510b227fb4fbc89f4f958 100644 (file)
@@ -1168,6 +1168,7 @@ mono_array_class_get (MonoType *element_type, guint32 rank)
                at->rank = rank;
                /* FIXME: complete.... */
        } else {
+               /* FIXME: this is not correct. the lbound could be >0 */
                class->byval_arg.type = MONO_TYPE_SZARRAY;
                class->byval_arg.data.type = &eclass->byval_arg;
        }
index f8d121128f2a5b9a261795f5cdc71f2b53eb372a..9bafb33833b44245ba8db7f60612c1188a352dcc 100644 (file)
@@ -563,7 +563,7 @@ mono_array_new_full (MonoDomain *domain, MonoClass *array_class,
        byte_len = mono_array_element_size (array_class);
        len = 1;
 
-       if (array_class->this_arg.type == MONO_TYPE_SZARRAY) {
+       if (array_class->rank == 1 && lower_bounds [0] == 0) {
                bounds = NULL;
                len = lengths [0];
        } else {