Merge pull request #956 from ermshiperete/bug-xamarin-14987
[mono.git] / mono / metadata / marshal.c
index b638b8fcd88042b9e73d6d391a72b96cd4f369b2..792a1dcf37eae662456b75b0dfa42202ec2db2b0 100644 (file)
@@ -4297,7 +4297,11 @@ mono_marshal_get_delegate_invoke (MonoMethod *method, MonoDelegate *del)
                invoke_sig = static_sig;
 
        if (static_method_with_first_arg_bound)
-               name = mono_signature_to_name (invoke_sig, "invoke_bound_");
+               name = mono_signature_to_name (invoke_sig, "invoke_bound");
+       else if (closed_over_null)
+               name = mono_signature_to_name (invoke_sig, "invoke_closed_over_null");
+       else if (callvirt)
+               name = mono_signature_to_name (invoke_sig, "invoke_callvirt");
        else
                name = mono_signature_to_name (sig, "invoke");
        if (ctx)
@@ -11800,7 +11804,9 @@ ves_icall_System_Runtime_InteropServices_Marshal_SizeOf (MonoReflectionType *rty
 
        layout = (klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK);
 
-       if (layout == TYPE_ATTRIBUTE_AUTO_LAYOUT) {
+       if (type->type == MONO_TYPE_PTR || type->type == MONO_TYPE_FNPTR) {
+               return sizeof (gpointer);
+       } else if (layout == TYPE_ATTRIBUTE_AUTO_LAYOUT) {
                gchar *msg;
                MonoException *exc;