Author: zoltan
Date: 2007-12-20 11:07:08 -0500 (Thu, 20 Dec 2007)
New Revision: 91715

Modified:
   trunk/mono/mono/metadata/ChangeLog
   trunk/mono/mono/metadata/marshal.c
Log:
2007-12-20  Zoltan Varga  <[EMAIL PROTECTED]>

        * marshal.c (mono_marshal_get_runtime_invoke): Put all runtime invoke 
wrappers
        for corlib classes into object. Fixes #349621.


Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog  2007-12-20 15:58:28 UTC (rev 91714)
+++ trunk/mono/mono/metadata/ChangeLog  2007-12-20 16:07:08 UTC (rev 91715)
@@ -1,3 +1,8 @@
+2007-12-20  Zoltan Varga  <[EMAIL PROTECTED]>
+
+       * marshal.c (mono_marshal_get_runtime_invoke): Put all runtime invoke 
wrappers
+       for corlib classes into object. Fixes #349621.
+
 2007-12-20  Gert Driesen  <[EMAIL PROTECTED]>
 
        * icall.c (property_accessor_nonpublic): new function to determine
@@ -10,7 +15,7 @@
 
 2007-12-20  Rodrigo Kumpera  <[EMAIL PROTECTED]>
 
-       * verify.c (init_stack_with_value): added
+       * verify.c (init_stack_with_value): added.
 
        * verify.c (mono_method_verify): extracted common
        code for exception initialization into init_stack_with_value.

Modified: trunk/mono/mono/metadata/marshal.c
===================================================================
--- trunk/mono/mono/metadata/marshal.c  2007-12-20 15:58:28 UTC (rev 91714)
+++ trunk/mono/mono/metadata/marshal.c  2007-12-20 16:07:08 UTC (rev 91715)
@@ -4994,7 +4994,19 @@
        }
 
        /* See bug #80743 */
-       target_klass = method->klass;
+       /*
+        * FIXME: Sharing runtime invoke wrappers between different methods 
means that
+        * calling a method of klass A might invoke the type initializer of 
class B.
+        * Normally, the type initializer of type B was already executed when 
B's method
+        * was called but in some complex cases this might not be true.
+        * See #349621 for an example. We avoid that for mscorlib methods by 
putting every
+        * wrapper into the object class, but the non-mscorlib case needs 
fixing.
+        */
+       if (method->klass->image == mono_defaults.corlib)
+               target_klass = mono_defaults.object_class;
+       else {
+               target_klass = method->klass;
+       }
 #if 0
        target_klass = mono_defaults.object_class;
        /* 

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

Reply via email to