[jit] Avoid running class cctors for remoting wrappers in the source domain. Fixes...
authorZoltan Varga <vargaz@gmail.com>
Fri, 2 Jun 2017 15:54:54 +0000 (11:54 -0400)
committerGitHub <noreply@github.com>
Fri, 2 Jun 2017 15:54:54 +0000 (11:54 -0400)
mono/mini/mini.c

index b2f16b7fe47cf613e1e591f761ac8167b4d2c2ca..10d6eac8b16d0b4a0306565c4a7642c07e5f1edd 100644 (file)
@@ -4335,8 +4335,12 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in
                }
        }
 
-       if (!mono_runtime_class_init_full (vtable, error))
-               return NULL;
+       if (!(method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE ||
+                 method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK ||
+                 method->wrapper_type == MONO_WRAPPER_XDOMAIN_INVOKE)) {
+               if (!mono_runtime_class_init_full (vtable, error))
+                       return NULL;
+       }
        return code;
 }