[Mono-bugs] [Bug 75260][Wis] New - [GMCS] gmcs generates unverifiable code for method overrides

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Jun 14 11:18:46 EDT 2005

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by nazgul at omega.pl.


--- shadow/75260	2005-06-14 11:18:45.000000000 -0400
+++ shadow/75260.tmp.3549	2005-06-14 11:18:45.000000000 -0400
@@ -0,0 +1,75 @@
+Bug#: 75260
+Product: Mono: Compilers
+Version: 1.0
+OS Details: PLD linux, mono from svn (13.07.2005)
+Status: NEW   
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: nazgul at omega.pl               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: [GMCS] gmcs generates unverifiable code for method overrides
+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.
+1 Error Verifying t.exe
+Expected Results:
+All classes Verified
+How often does this happen? 
+Additional Information:
+There are differences of how method signature appears in IL.
+  .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).

More information about the mono-bugs mailing list