[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-patches
Subject:    [Mono-patches] r114513 - in trunk/mono/mono: metadata tests
From:       "Mark Probst (mprobst () novell ! com)" <mono-patches-list () lists ! ximian ! com>
Date:       2008-09-30 21:26:08
Message-ID: 20080930212608.0F7CC9472C () mono-cvs ! ximian ! com
[Download RAW message or body]

Author: mprobst
Date: 2008-09-30 17:26:07 -0400 (Tue, 30 Sep 2008)
New Revision: 114513

Added:
   trunk/mono/mono/tests/generic-constrained.2.il
Modified:
   trunk/mono/mono/metadata/ChangeLog
   trunk/mono/mono/metadata/loader.c
   trunk/mono/mono/tests/ChangeLog
   trunk/mono/mono/tests/Makefile.am
Log:
2008-09-30  Mark Probst  <mark.probst@gmail.com>

	* loader.c (mono_get_method_constrained): Don't expand method with
	the class's context, because it's already a method of that class.

2008-09-30  Mark Probst  <mark.probst@gmail.com>

	* generic-constrained.2.il: Test case for the constrained. prefix
	with generic interfaces.

	* Makefile.am: Test added.


Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog	2008-09-30 21:24:01 UTC (rev 114512)
+++ trunk/mono/mono/metadata/ChangeLog	2008-09-30 21:26:07 UTC (rev 114513)
@@ -1,3 +1,8 @@
+2008-09-30  Mark Probst  <mark.probst@gmail.com>
+
+	* loader.c (mono_get_method_constrained): Don't expand method with
+	the class's context, because it's already a method of that class.
+
 2008-09-30  Atsushi Enomoto  <atsushi@ximian.com>
 
 	* attach.c : should be correct build fix.

Modified: trunk/mono/mono/metadata/loader.c
===================================================================
--- trunk/mono/mono/metadata/loader.c	2008-09-30 21:24:01 UTC (rev 114512)
+++ trunk/mono/mono/metadata/loader.c	2008-09-30 21:26:07 UTC (rev 114513)
@@ -1514,7 +1514,7 @@
 {
 	MonoMethod *method, *result;
 	MonoClass *ic = NULL;
-	MonoGenericContext *class_context = NULL, *method_context = NULL;
+	MonoGenericContext *method_context = NULL;
 	MonoMethodSignature *sig, *original_sig;
 
 	mono_loader_lock ();
@@ -1552,9 +1552,6 @@
 	if ((constrained_class != method->klass) && (method->klass->interface_id != 0))
 		ic = method->klass;
 
-	if (constrained_class->generic_class)
-		class_context = mono_class_get_context (constrained_class);
-
 	result = find_method (constrained_class, ic, method->name, sig, constrained_class);
 	if (sig != original_sig)
 		mono_metadata_free_inflated_signature (sig);
@@ -1566,8 +1563,6 @@
 		return NULL;
 	}
 
-	if (class_context)
-		result = mono_class_inflate_generic_method (result, class_context);
 	if (method_context)
 		result = mono_class_inflate_generic_method (result, method_context);
 

Modified: trunk/mono/mono/tests/ChangeLog
===================================================================
--- trunk/mono/mono/tests/ChangeLog	2008-09-30 21:24:01 UTC (rev 114512)
+++ trunk/mono/mono/tests/ChangeLog	2008-09-30 21:26:07 UTC (rev 114513)
@@ -1,3 +1,10 @@
+2008-09-30  Mark Probst  <mark.probst@gmail.com>
+
+	* generic-constrained.2.il: Test case for the constrained. prefix
+	with generic interfaces.
+
+	* Makefile.am: Test added.
+
 2008-09-29  Zoltan Varga  <vargaz@gmail.com>
 
 	* Makefile.am (PLATFORM_DISABLED_TESTS): Disable some tests on ia64.

Modified: trunk/mono/mono/tests/Makefile.am
===================================================================
--- trunk/mono/mono/tests/Makefile.am	2008-09-30 21:24:01 UTC (rev 114512)
+++ trunk/mono/mono/tests/Makefile.am	2008-09-30 21:26:07 UTC (rev 114513)
@@ -407,6 +407,7 @@
 	generic-array-exc.2.il	\
 	generic-valuetype-newobj2.2.il	\
 	generic-valuetype-newobj.2.il	\
+	generic-constrained.2.il	\
 	bug-81466.il
 
 #	bug-318677.il
@@ -708,7 +709,8 @@
 		generic-virtual2.2.exe generic-valuetype-interface.2.exe	\
 		generic-valuetype-newobj.2.exe generic-valuetype-newobj2.2.exe	\
 		generic-getgenericarguments.2.exe generic-type-builder.2.exe	\
-		generic-synchronized.2.exe generic-delegate-ctor.2.exe
+		generic-synchronized.2.exe generic-delegate-ctor.2.exe		\
+		generic-constrained.2.exe
 	@for fn in $+ ; do	\
 		echo "Testing $$fn ...";	\
 		MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared                $$fn > $$fn.stdout \
|| exit 1;	\

Added: trunk/mono/mono/tests/generic-constrained.2.il
===================================================================
--- trunk/mono/mono/tests/generic-constrained.2.il	2008-09-30 21:24:01 UTC (rev \
                114512)
+++ trunk/mono/mono/tests/generic-constrained.2.il	2008-09-30 21:26:07 UTC (rev \
114513) @@ -0,0 +1,118 @@
+.assembly extern mscorlib
+{
+  .ver 2:0:0:0
+  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
+}
+.assembly 'bla'
+{
+  .custom instance void class \
[mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::'.ctor'() =  \
( +		01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78   // ....T..WrapNonEx
+		63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01       ) // ceptionThrows.
+
+  .hash algorithm 0x00008004
+  .ver  0:0:0:0
+}
+.module bla.exe // GUID = {B0BB2CAE-B57B-48F6-BDD2-2B93A6A7F57F}
+
+
+  .class interface public auto ansi abstract IGen`1<IGenT>
+  {
+
+    // method line 1
+    .method public virtual  hidebysig  newslot  abstract 
+           instance default int32 bla ()  cil managed 
+    {
+        // Method begins at RVA 0x0
+    } // end of method IGen`1::bla
+
+  } // end of class IGen`1
+
+  .class public sequential ansi sealed beforefieldinit Gen`1<GenT>
+  	extends [mscorlib]System.ValueType
+  	implements class IGen`1<!0>  {
+
+    // method line 2
+    .method public final  virtual  hidebysig  newslot 
+           instance default int32 bla ()  cil managed 
+    {
+        // Method begins at RVA 0x20ec
+	// Code size 3 (0x3)
+	.maxstack 8
+	IL_0000:  ldc.i4.s 0x7b
+	IL_0002:  ret 
+    } // end of method Gen`1::bla
+
+  } // end of class Gen`1
+
+  .class private auto ansi beforefieldinit A`2<S,T>
+  	extends [mscorlib]System.Object
+  {
+
+    // method line 3
+    .method public hidebysig  specialname  rtspecialname 
+           instance default void '.ctor' ()  cil managed 
+    {
+        // Method begins at RVA 0x20f0
+	// Code size 7 (0x7)
+	.maxstack 8
+	IL_0000:  ldarg.0 
+	IL_0001:  call instance void object::'.ctor'()
+	IL_0006:  ret 
+    } // end of method A`2::.ctor
+
+    // method line 4
+    .method public hidebysig 
+           instance default int32 Foo (valuetype Gen`1<!T> t)  cil managed 
+    {
+        // Method begins at RVA 0x20f8
+	// Code size 8 (0x8)
+	.maxstack 8
+	IL_0000:  ldarga.s 1
+		  constrained. valuetype Gen`1<!T>
+	IL_0006:  callvirt instance int32 class IGen`1<!T>::bla()
+	IL_0007:  ret 
+    } // end of method A`2::Foo
+
+  } // end of class A`2
+
+  .class public auto ansi beforefieldinit main
+  	extends [mscorlib]System.Object
+  {
+
+    // method line 5
+    .method public hidebysig  specialname  rtspecialname 
+           instance default void '.ctor' ()  cil managed 
+    {
+        // Method begins at RVA 0x2104
+	// Code size 7 (0x7)
+	.maxstack 8
+	IL_0000:  ldarg.0 
+	IL_0001:  call instance void object::'.ctor'()
+	IL_0006:  ret 
+    } // end of method main::.ctor
+
+    // method line 6
+    .method public static  hidebysig 
+           default int32 Main ()  cil managed 
+    {
+        // Method begins at RVA 0x210c
+	.entrypoint
+	// Code size 24 (0x18)
+	.maxstack 3
+	.locals init (
+		valuetype Gen`1<string>	V_0,
+		class A`2<object, string>	V_1)
+	IL_0000:  ldloca.s 0
+	IL_0002:  initobj valuetype Gen`1<string>
+	IL_0008:  newobj instance void class A`2<object, string>::'.ctor'()
+	IL_000d:  stloc.1 
+	IL_000e:  ldloc.1 
+	IL_000f:  ldloc.0 
+	IL_0010:  callvirt instance int32 class A`2<object, string>::Foo(valuetype \
Gen`1<!1>) +	IL_0015:  pop 
+	IL_0016:  ldc.i4.0 
+	IL_0017:  ret 
+    } // end of method main::Main
+
+  } // end of class main
+

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic