2009-04-07 Rodrigo Kumpera <rkumpera@novell.com>
authorRodrigo Kumpera <kumpera@gmail.com>
Tue, 7 Apr 2009 22:30:00 +0000 (22:30 -0000)
committerRodrigo Kumpera <kumpera@gmail.com>
Tue, 7 Apr 2009 22:30:00 +0000 (22:30 -0000)
* loader.c (method_from_memberref): If ít's a memberref to a typespec inflate
the signature and search the inflated type.

We can't blindly search the generic type definition or expect that the signature
will be inflated as both options can happen. The only solution is to search the
inflated type against the inflated signature.

Fixes #492778.

svn path=/trunk/mono/; revision=131263

mono/metadata/ChangeLog
mono/metadata/loader.c

index 4c26c8544000c0034f5ae83707a4bde08682f2e8..f6620d9f883acebd26e4180921114e765531f671 100644 (file)
@@ -1,3 +1,14 @@
+2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
+
+       * loader.c (method_from_memberref): If ít's a memberref to a typespec inflate
+       the signature and search the inflated type.
+
+       We can't blindly search the generic type definition or expect that the signature
+       will be inflated as both options can happen. The only solution is to search the
+       inflated type against the inflated signature.
+
+       Fixes #492778.
+
 2009-04-07  Zoltan Varga  <vargaz@gmail.com>
 
        * debug-helpers.c (dis_one): Decode string arguments.
index f1d7fc63015641ff458ff6b4c1cd1806cbfa3427..7b4623c09a991517e74a8caacf449091e274ad41 100644 (file)
@@ -932,8 +932,13 @@ method_from_memberref (MonoImage *image, guint32 idx, MonoGenericContext *typesp
                type = &klass->byval_arg;
 
                if (type->type != MONO_TYPE_ARRAY && type->type != MONO_TYPE_SZARRAY) {
-                       MonoClass *in_class = klass->generic_class ? klass->generic_class->container_class : klass;
-                       method = find_method (in_class, NULL, mname, sig, klass);
+                       MonoMethodSignature *in_sig = sig;
+                       if (klass->generic_class)
+                               in_sig = inflate_generic_signature (NULL, sig, &klass->generic_class->context);
+
+                       method = find_method (klass, NULL, mname, in_sig, klass);
+                       if (in_sig != sig)
+                               mono_metadata_free_inflated_signature (in_sig);
                        break;
                }