2002-08-02 Dietmar Maurer <dietmar@ximian.com>
authorDietmar Maurer <dietmar@mono-cvs.ximian.com>
Fri, 2 Aug 2002 07:13:54 +0000 (07:13 -0000)
committerDietmar Maurer <dietmar@mono-cvs.ximian.com>
Fri, 2 Aug 2002 07:13:54 +0000 (07:13 -0000)
* marshal.c (mono_delegate_to_ftnptr): pass delegate->target
instead of the delegate itself as this pointer (bug #28383)

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

mono/arch/x86/tramp.c
mono/metadata/ChangeLog
mono/metadata/marshal.c

index 8e07996d43d453b7ccfec31272dd9cad344d066a..4046f5dab7819f09bd937bce0d10bac11418525f 100644 (file)
@@ -3,7 +3,9 @@
  * 
  * Copyright (C) Ximian Inc.
  * 
- * Author: Paolo Molaro (lupus@ximian.com)
+ * Authors: 
+ *   Paolo Molaro (lupus@ximian.com)
+ *   Dietmar Maurer (dietmar@ximian.com)
  * 
  */
 
@@ -528,7 +530,6 @@ mono_create_method_pointer (MonoMethod *method)
                        x86_push_imm (p, sig->ret);
                        x86_mov_reg_imm (p, X86_ECX, stackval_to_data);
                        x86_call_reg (p, X86_ECX);
-                       //x86_breakpoint (p);
                        x86_alu_reg_imm (p, X86_SUB, X86_ESP, 16);
                        
                        break;
index 71739b485fa4a8e6aeadb8468de3dd92d9c755be..9712063dfc08cf896eb337770885f18eedc1e0bb 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-02  Dietmar Maurer  <dietmar@ximian.com>
+
+       * marshal.c (mono_delegate_to_ftnptr): pass delegate->target
+       instead of the delegate itself as this pointer (bug #28383)
+
 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
 
        * marshal.c (mono_marshal_get_managed_wrapper): added return type
index 768266d64b1625d486ada27880e8081ef535144b..c167e737381ca5ddc8bea48590703b4d955dc02f 100644 (file)
@@ -74,7 +74,7 @@ mono_delegate_to_ftnptr (MonoDelegate *delegate)
        g_assert (klass->delegate);
        
        method = delegate->method_info->method;
-       wrapper = mono_marshal_get_managed_wrapper (method, (MonoObject *)delegate);
+       wrapper = mono_marshal_get_managed_wrapper (method, delegate->target);
 
        delegate->delegate_trampoline =  mono_compile_method (wrapper);
 
@@ -1863,6 +1863,9 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoObject *this)
        case MONO_TYPE_U8:
                /* do nothing */
                break;
+       case MONO_TYPE_STRING:
+               g_assert_not_reached ();
+               break;
        case MONO_TYPE_VALUETYPE: {
                int tmp;
                klass = sig->ret->data.klass;