Make the synchronized wrappers static if the original method was static. Fixes shared...
authorZoltan Varga <vargaz@gmail.com>
Mon, 8 Jul 2013 16:24:39 +0000 (18:24 +0200)
committerZoltan Varga <vargaz@gmail.com>
Mon, 8 Jul 2013 16:24:51 +0000 (18:24 +0200)
mono/metadata/marshal.c

index c7ea811accafaa6df3238554e43b0b60f1b2734b..8a192fc02a8cd0472d03982e3d9624337dcb0771 100644 (file)
@@ -10502,6 +10502,8 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
        if (ctx) {
                MonoMethod *def;
                def = mono_mb_create_and_cache (cache, method, mb, sig, sig->param_count + 16);
+               if (method->flags & METHOD_ATTRIBUTE_STATIC)
+                       def->flags |= METHOD_ATTRIBUTE_STATIC;
                res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
        } else {
                res = mono_mb_create_and_cache (cache, method,