[Mono-dev] custom mscorlib.dll with fields in .Array

Robert Jordan robertj at gmx.net
Fri Jun 5 05:51:17 EDT 2009

banan wrote:
> I need to use custom mscorlib.dll library with some fields defined in
> System.Array. csc on .net compiles assemblies referencing it with no
> problem, but when trying to compile anything referencing this mscorlib.dll
> with gmcs (Mono 2.4) an assertion fault occurs in metadata/class.c at the
> code
> 	/* reserve space to store vector pointer in arrays */
> 	if (!strcmp (nspace, "System") && !strcmp (name, "Array")) {
> 		class->instance_size += 2 * sizeof (gpointer);
> 		g_assert (class->field.count == 0);
> 	}
> The question is: am I violating the standard or it is a bug in mono?

It's a bug in mono. Test case:

namespace System
	public class Array {
		public int Foo;

		static void Main ()

The code in class.c does not check if the System.Array type
is originating from mscorlib. See attached patch.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: class.diff
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090605/3f8ae41e/attachment.pl 

More information about the Mono-devel-list mailing list