[Mono-dev] gmcs bug with unsafe code

Dan Shechter dans at houmus.org
Wed Aug 27 21:52:33 EDT 2008


Hi,

I've been trying out gmcs, running on Ubuntu 8.04 amd64 and have discovered
a rather annoying fault:

 

When compiling classes containing statements such as:

 

namespace YYY {

class XXX {
private unsafe byte *_data;

public unsafe byte *GetData() { return _data; }}

}

}

 

The compiler will notify of a failure:

error CS3003: Type of `YYY.XXX._data' is not CLS-compliant

 

and immediately fault with:

Internal compiler error at ./XXX.cs(64,25):: exception caught while emitting
MethodBuilder [XXX:: GetData]

 

Unhandled Exception: System.ArgumentException: Key duplication when adding:
System.Byte*

  at System.Collections.Hashtable.PutImpl (System.Object key, System.Object
value, Boolean overwrite) [0x00000]

  at System.Collections.Hashtable.Add (System.Object key, System.Object
value) [0x00000]

  at Mono.CSharp.AttributeTester.IsClsCompliant (System.Type type) [0x00000]

  at Mono.CSharp.MethodCore.VerifyClsCompliance () [0x00000]

  at Mono.CSharp.Method.VerifyClsCompliance () [0x00000]

  at Mono.CSharp.MemberCore.Emit () [0x00000]

  at Mono.CSharp.InterfaceMemberBase.Emit () [0x00000]

  at Mono.CSharp.MethodOrOperator.Emit () [0x00000]

  at Mono.CSharp.Method.Emit () [0x00000]

 

turning off cls checks with "-clscheck-" passed to gmcs will go around this
problem.

 

I will file an official bug report.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080828/a7803e5e/attachment.html 


More information about the Mono-devel-list mailing list