[interp] respect remoting proxies when resolving virtual methods
authorBernhard Urban <bernhard.urban@xamarin.com>
Thu, 1 Jun 2017 19:30:09 +0000 (21:30 +0200)
committerBernhard Urban <bernhard.urban@xamarin.com>
Fri, 2 Jun 2017 15:18:45 +0000 (17:18 +0200)
mono/mini/interp/interp.c

index 6e985993483d262a94c4e748660aa6b822c75962..9a2f3255b8a2e90ea4f85a054980abe84a6ec9e6 100644 (file)
@@ -337,16 +337,18 @@ get_virtual_method (RuntimeMethod *runtime_method, MonoObject *obj)
 {
        MonoMethod *m = runtime_method->method;
        MonoDomain *domain = runtime_method->domain;
+       RuntimeMethod *ret = NULL;
        MonoError error;
 
-       if ((m->flags & METHOD_ATTRIBUTE_FINAL) || !(m->flags & METHOD_ATTRIBUTE_VIRTUAL)) {
-               RuntimeMethod *ret = NULL;
 #ifndef DISABLE_REMOTING
-               if (mono_object_is_transparent_proxy (obj)) {
-                       ret = mono_interp_get_runtime_method (domain, mono_marshal_get_remoting_invoke (m), &error);
-                       mono_error_cleanup (&error); /* FIXME: don't swallow the error */
-               } else
+       if (mono_object_is_transparent_proxy (obj)) {
+               ret = mono_interp_get_runtime_method (domain, mono_marshal_get_remoting_invoke (m), &error);
+               mono_error_assert_ok (&error);
+               return ret;
+       }
 #endif
+
+       if ((m->flags & METHOD_ATTRIBUTE_FINAL) || !(m->flags & METHOD_ATTRIBUTE_VIRTUAL)) {
                if (m->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED) {
                        ret = mono_interp_get_runtime_method (domain, mono_marshal_get_synchronized_wrapper (m), &error);
                        mono_error_cleanup (&error); /* FIXME: don't swallow the error */