[Mono-devel-list] Two mcs unsafe code bugs

Martin Baulig martin at ximian.com
Fri Aug 27 10:01:20 EDT 2004


Hello,

can you please file a bug report in bugzilla, so we don't loose this ?

Thanks,
Martin

On Fri, 2004-08-27 at 11:48 +0200, Jeroen Frijters wrote:
> Hi,
> 
> I found two small bugs in mcs when dealing with unsafe code.
> 
> In Method1 mcs complains about the second local variable p and in
> Method2 in wants me to use a fixed block, but since MyStruct* p is
> already an unmanaged pointer that doesn't make sense.
> 
> Regards,
> Jeroen
> 
> >>> unsafe.cs <<<
> using System.Runtime.InteropServices;
> 
> struct MyStruct
> {
>   internal int p;
> }
> 
> class test
> {
>   int bar;
> 
>   unsafe void Method1()
>   {
>     fixed(void* p = &bar) {}
>     fixed(void* p = &bar) {}
>   }
> 
>   unsafe void Method2(MyStruct* p)
>   {
>     void* pv = &p->p;
>   }
> }
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 




More information about the Mono-devel-list mailing list