Author: lupus
Date: 2007-10-03 10:59:01 -0400 (Wed, 03 Oct 2007)
New Revision: 86812

Modified:
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/mini-trampolines.c
Log:


Wed Oct 3 17:11:38 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>

        * mini-trampolines.c: fixed an assertion and moved it earlier in the
        code, before interface_offset gets used.



Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog      2007-10-03 14:24:47 UTC (rev 86811)
+++ trunk/mono/mono/mini/ChangeLog      2007-10-03 14:59:01 UTC (rev 86812)
@@ -1,3 +1,9 @@
+
+Wed Oct 3 17:11:38 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>
+
+       * mini-trampolines.c: fixed an assertion and moved it earlier in the
+       code, before interface_offset gets used.
+
 2007-10-02  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * mini-trampolines.c (mono_convert_imt_slot_to_vtable_slot): Call 

Modified: trunk/mono/mono/mini/mini-trampolines.c
===================================================================
--- trunk/mono/mono/mini/mini-trampolines.c     2007-10-03 14:24:47 UTC (rev 
86811)
+++ trunk/mono/mono/mini/mini-trampolines.c     2007-10-03 14:59:01 UTC (rev 
86812)
@@ -30,10 +30,16 @@
                return slot;
        } else {
                MonoMethod *imt_method = mono_arch_find_imt_method (regs, code);
-               int interface_offset = mono_class_interface_offset (vt->klass, 
imt_method->klass);
+               int interface_offset;
                int imt_slot = MONO_IMT_SIZE + displacement;
+
                mono_class_setup_vtable (vt->klass);
+               interface_offset = mono_class_interface_offset (vt->klass, 
imt_method->klass);
 
+               if (interface_offset < 0) {
+                       g_print ("%s doesn't implement interface %s\n", 
mono_type_get_name_full (&vt->klass->byval_arg, 0), mono_type_get_name_full 
(&imt_method->klass->byval_arg, 0));
+                       g_assert_not_reached ();
+               }
                mono_vtable_build_imt_slot (vt, mono_method_get_imt_slot 
(imt_method));
 
                if (impl_method)
@@ -50,7 +56,6 @@
 #if DEBUG_IMT
                        printf ("mono_convert_imt_slot_to_vtable_slot: slot 
%p[%d] is in the IMT, and colliding becomes %p[%d] (interface_offset = %d, 
method->slot = %d)\n", slot, imt_slot, vtable_slot, vtable_offset, 
interface_offset, imt_method->slot);
 #endif
-                       g_assert (vtable_offset >= 0);
                        return vtable_slot;
                } else {
 #if DEBUG_IMT

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

Reply via email to