[Mono-bugs] [Bug 53147][Nor] New - miscompilation (likely wrong type encoding)

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 20 Jan 2004 16:26:40 -0500 (EST)


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 lupus@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=53147

--- shadow/53147	2004-01-20 16:26:40.000000000 -0500
+++ shadow/53147.tmp.25288	2004-01-20 16:26:40.000000000 -0500
@@ -0,0 +1,114 @@
+Bug#: 53147
+Product: Mono/Compilers
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: IL assembler
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: lupus@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: miscompilation (likely wrong type encoding)
+
+ilasm miscompiles the following sample.
+The issue is caught by PEVerify and mono, but not by pedump.
+PEVerify gives:
+[MD]: Error: TypeRef has a duplicate, token=0x01000002. [token:0x01000001]
+[MD]: Error: TypeRef has a duplicate, token=0x01000001. [token:0x01000002]
+[MD]: Error: Token 0x02000003 following ELEMENT_TYPE_CLASS (_VALUETYPE) in
+signature is a ValueType (Class,respectively). [token:0x11000003]
+
+
+.assembly extern mscorlib
+{
+  .ver 1:0:3300:0
+}
+.assembly 'test-iface-override2'
+{
+  .hash algorithm 0x00008004
+  .ver  0:0:0:0
+}
+.module 'test-iface-override2.exe' // GUID =
+{71F7213A-C499-46F6-B12C-19576947E341}
+
+
+  .class interface private auto ansi abstract 'I'
+  {
+
+    // method line 1
+    .method public virtual  hidebysig  newslot  abstract 
+           instance default void 'meth' ()  cil managed 
+    {
+        // Method begins at RVA 0x0
+    } // end of method I::instance default void 'meth' () 
+
+  } // end of type I
+
+  .class private auto ansi beforefieldinit 'C1'
+  	extends [mscorlib]System.Object
+  	implements I  {
+
+    // method line 2
+    .method public hidebysig  specialname  rtspecialname 
+           instance default void .ctor ()  cil managed 
+    {
+        // Method begins at RVA 0x20ec
+	// Code size 7 (0x7)
+	.maxstack 8
+	IL_0000:  ldarg.0 
+	IL_0001:  call instance void valuetype [mscorlib]'System.Object'::.ctor()
+	IL_0006:  ret 
+    } // end of method C1::instance default void .ctor () 
+
+    // method line 3
+    .method public virtual  hidebysig  newslot 
+           instance default void 'meth' ()  cil managed 
+    {
+        // Method begins at RVA 0x20f4
+	// Code size 1 (0x1)
+	.maxstack 8
+	IL_0000:  ret 
+    } // end of method C1::instance default void 'meth' () 
+
+  } // end of type C1
+
+  .class private auto ansi beforefieldinit 'C2'
+  	extends C1
+  	implements I  {
+
+    // method line 4
+    .method public hidebysig  specialname  rtspecialname 
+           instance default void .ctor ()  cil managed 
+    {
+        // Method begins at RVA 0x20f6
+	// Code size 7 (0x7)
+	.maxstack 8
+	IL_0000:  ldarg.0 
+	IL_0001:  call instance void class 'C1'::.ctor()
+	IL_0006:  ret 
+    } // end of method C2::instance default void .ctor () 
+
+    // method line 5
+    .method private static 
+           default void 'Main' ()  cil managed 
+    {
+        // Method begins at RVA 0x20fe
+	.entrypoint
+	// Code size 13 (0xd)
+	.maxstack 2
+	.locals init (
+		class 'C2'	V_0)
+	IL_0000:  newobj instance void class 'C2'::.ctor()
+	IL_0005:  stloc.0 
+	IL_0006:  ldloc.0 
+	IL_0007:  callvirt instance void class 'I'::'meth'()
+	IL_000c:  ret 
+    } // end of method C2::default void 'Main' () 
+
+  } // end of type C2