Author: zoltan
Date: 2007-03-14 12:49:13 -0500 (Wed, 14 Mar 2007)
New Revision: 74289

Modified:
   trunk/mono/mono/metadata/ChangeLog
   trunk/mono/mono/metadata/reflection.c
Log:
2007-03-14  Zoltan Varga  <[EMAIL PROTECTED]>

        * reflection.c (mono_reflection_create_dynamic_method): Fix the last 
change so
        multiple circular calls made from the same DynamicMethod work. Fixes 
#81141.


Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog  2007-03-14 17:41:09 UTC (rev 74288)
+++ trunk/mono/mono/metadata/ChangeLog  2007-03-14 17:49:13 UTC (rev 74289)
@@ -1,5 +1,8 @@
 2007-03-14  Zoltan Varga  <[EMAIL PROTECTED]>
 
+       * reflection.c (mono_reflection_create_dynamic_method): Fix the last 
change so
+       multiple circular calls made from the same DynamicMethod work. Fixes 
#81141.
+
        * image.c (mono_image_lookup_resource): Make this work on big-endian
        machines.Change API contract so the caller needs to free the return 
value.
        

Modified: trunk/mono/mono/metadata/reflection.c
===================================================================
--- trunk/mono/mono/metadata/reflection.c       2007-03-14 17:41:09 UTC (rev 
74288)
+++ trunk/mono/mono/metadata/reflection.c       2007-03-14 17:49:13 UTC (rev 
74289)
@@ -9549,13 +9549,14 @@
                        /*
                         * The referenced DynamicMethod should already be 
created by the managed
                         * code, except in the case of circular references. In 
that case, we store
-                        * NULL in the refs array, and fix it up later when the 
referenced 
+                        * method in the refs array, and fix it up later when 
the referenced 
                         * DynamicMethod is created.
                         */
                        if (method->mhandle) {
                                ref = method->mhandle;
                        } else {
-                               ref = NULL;
+                               /* FIXME: GC object stored in unmanaged memory 
*/
+                               ref = method;
 
                                /* FIXME: GC object stored in unmanaged memory 
*/
                                method->referenced_by = g_slist_append 
(method->referenced_by, mb);
@@ -9587,7 +9588,7 @@
 
                data = (gpointer*)wrapper->method_data;
                for (i = 0; i < GPOINTER_TO_UINT (data [0]); i += 2) {
-                       if ((data [i + 1] == NULL) && (data [i + 1 + 1] == 
mono_defaults.methodhandle_class))
+                       if ((data [i + 1] == mb) && (data [i + 1 + 1] == 
mono_defaults.methodhandle_class))
                                data [i + 1] = mb->mhandle;
                }
        }

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

Reply via email to