Author: robertj
Date: 2007-09-08 18:36:32 -0400 (Sat, 08 Sep 2007)
New Revision: 85526

Modified:
   trunk/mono/mono/metadata/ChangeLog
   trunk/mono/mono/metadata/object.c
Log:
2007-09-09  Robert Jordan  <[EMAIL PROTECTED]>

        * object.c (mono_class_proxy_vtable): Don't create remoting trampolines
        for generic methods.

        * object.c (mono_object_get_virtual_method): Handle generic methods.
        Fixes bug #78882.

        Code is contributed under MIT/X11 license.



Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog  2007-09-08 22:28:07 UTC (rev 85525)
+++ trunk/mono/mono/metadata/ChangeLog  2007-09-08 22:36:32 UTC (rev 85526)
@@ -1,4 +1,14 @@
 
+2007-09-09  Robert Jordan  <[EMAIL PROTECTED]>
+
+       * object.c (mono_class_proxy_vtable): Don't create remoting trampolines
+       for generic methods.
+
+       * object.c (mono_object_get_virtual_method): Handle generic methods.
+       Fixes bug #78882.
+
+       Code is contributed under MIT/X11 license.
+
 Sat Sep 8 18:16:01 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>
 
        * image.c: fix locking in mono_image_load_file_for_image ().

Modified: trunk/mono/mono/metadata/object.c
===================================================================
--- trunk/mono/mono/metadata/object.c   2007-09-08 22:28:07 UTC (rev 85525)
+++ trunk/mono/mono/metadata/object.c   2007-09-08 22:36:32 UTC (rev 85526)
@@ -1560,7 +1560,8 @@
                MonoMethod *cm;
                    
                if ((cm = class->vtable [i]))
-                       pvt->vtable [i] = arch_create_remoting_trampoline (cm, 
target_type);
+                       pvt->vtable [i] = mono_method_signature 
(cm)->generic_param_count
+                               ? cm : arch_create_remoting_trampoline (cm, 
target_type);
        }
 
        if (class->flags & TYPE_ATTRIBUTE_ABSTRACT) {
@@ -1570,7 +1571,7 @@
                        gpointer iter = NULL;
                        while ((m = mono_class_get_methods (k, &iter)))
                                if (!pvt->vtable [m->slot])
-                                       pvt->vtable [m->slot] = 
arch_create_remoting_trampoline (m, target_type);
+                                       pvt->vtable [m->slot] = 
mono_method_signature (m)->generic_param_count ? m : 
arch_create_remoting_trampoline (m, target_type);
                }
        }
 
@@ -1609,7 +1610,7 @@
                        iter = NULL;
                        j = 0;
                        while ((cm = mono_class_get_methods (interf, &iter)))
-                               pvt->vtable [slot + j++] = 
arch_create_remoting_trampoline (cm, target_type);
+                               pvt->vtable [slot + j++] = 
mono_method_signature (cm)->generic_param_count ? cm : 
arch_create_remoting_trampoline (cm, target_type);
                        
                        slot += mono_class_num_methods (interf);
                }
@@ -1933,8 +1934,15 @@
        }
 
        if (is_proxy) {
-               if (!res) res = method;   /* It may be an interface or abstract 
class method */
-               res = mono_marshal_get_remoting_invoke (res);
+               /* It may be an interface, abstract class method or generic 
method */
+               if (!res || mono_method_signature (res)->generic_param_count)
+                       res = method;
+
+               /* generic methods demand invoke_with_check */
+               if (mono_method_signature (res)->generic_param_count)
+                       res = mono_marshal_get_remoting_invoke_with_check (res);
+               else
+                       res = mono_marshal_get_remoting_invoke (res);
        }
 
        g_assert (res);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to