Bugzilla – Bug 318263
[GMCS] gmcs generates unverifiable code for method overrides
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by nazgul@omega.pl 2005-06-14 11:18:45 MST ---- Please fill in this template when reporting a bug, unless you know what you are doing. Description of Problem: When running PEVerify from .NET 2.0 beta2 on assemblies generated by mono S.R.E (thus also by gmcs) there are problems with method overrides. This affects all compilers using mono S.R.E. including Nemerle. There are two effects of this problem: 1) we are unable to verify the assemblies generated by mono (in seek of problems with miscompiled IL - monodis doesn't work well for generic code) 2) possibly it is a real problem, for example when you compile class implementing the same interface under different instantiations Steps to reproduce the problem: 1. Compile following code with gmcs interface IColl <T> { T Foo (string x, T y); } class C : IColl <int> { int IColl<int>.Foo (string x, int y) { return y; } } class M { static void Main () { } } 2. Do the PEVerify.exe on it Actual Results: [MD]: Error: MethodImpl's Decl and Body method signatures do not match. [token:0x00000001] 1 Error Verifying t.exe Expected Results: All classes Verified How often does this happen? Always Additional Information: There are differences of how method signature appears in IL. Mono: .override IColl`1::Foo on MS.NET: .override method instance !0 class IColl`1<int32>::Foo(string, !0) (the !0 here is probably just an ildasm bug) As we can see, when specifying overrides compilers and S.R.E should use / save the instantiaded version of overriden method (one of the purposes of TypeBuilder.GetMethod stuff). ---- Additional Comments From martin@ximian.com 2005-06-15 14:32:20 MST ---- Fixed in SVN. Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>PLD linux, mono from svn (13.07.2005)</cf_op_sys_details> Unknown operating system unknown. Setting to default OS "Other".