[llvmonly] Fix the invocation of generic array helpers, they need an rgctx arg.
authorZoltan Varga <vargaz@gmail.com>
Sun, 24 Jan 2016 03:09:37 +0000 (22:09 -0500)
committerZoltan Varga <vargaz@gmail.com>
Sun, 24 Jan 2016 03:09:40 +0000 (22:09 -0500)
mono/mini/aot-tests.cs
mono/mini/mini-runtime.c

index e3ac943c00e35a46a94a0e9ce886f5bc079a7718..bd823f2b9062cce310ff2791ed9c39a5876c1d44 100644 (file)
@@ -467,4 +467,12 @@ class Tests
                var m2 = typeof (GetCurrentMethodClass<>).GetMethod ("get_current");
                return m == m2 ? 0 : 1;
        }
+
+       public static int test_0_array_wrappers_runtime_invoke () {
+               string[][] arr = new string [10][];
+               IEnumerable<string[]> iface = arr;
+               var m = typeof(IEnumerable<string[]>).GetMethod ("GetEnumerator");
+               m.Invoke (arr, null);
+               return 0;
+       }
 }
index 8e8a04aa1976e12aefb3314df5f4c8c9d2f1e6c0..c73c19ffcef9b013900144ce5da667272a6ec2c1 100644 (file)
@@ -2287,15 +2287,14 @@ create_runtime_invoke_info (MonoDomain *domain, MonoMethod *method, gpointer com
 #ifndef ENABLE_GSHAREDVT
                        g_assert_not_reached ();
 #endif
+                       info->gsharedvt_invoke = TRUE;
                        if (!callee_gsharedvt) {
                                /* Invoke a gsharedvt out wrapper instead */
                                MonoMethod *wrapper = mini_get_gsharedvt_out_sig_wrapper (sig);
                                MonoMethodSignature *wrapper_sig = mini_get_gsharedvt_out_sig_wrapper_signature (sig->hasthis, sig->ret->type != MONO_TYPE_VOID, sig->param_count);
 
-                               info->gsharedvt_invoke = TRUE;
                                info->wrapper_arg = g_malloc0 (2 * sizeof (gpointer));
-                               info->wrapper_arg [0] = info->compiled_method;
-                               info->wrapper_arg [1] = mono_method_needs_static_rgctx_invoke (method, TRUE) ? mini_method_get_rgctx (method) : NULL;
+                               info->wrapper_arg [0] = mini_add_method_wrappers_llvmonly (method, info->compiled_method, FALSE, FALSE, &(info->wrapper_arg [1]));
 
                                /* Pass has_rgctx == TRUE since the wrapper has an extra arg */
                                invoke = mono_marshal_get_runtime_invoke_for_sig (wrapper_sig);
@@ -2307,7 +2306,6 @@ create_runtime_invoke_info (MonoDomain *domain, MonoMethod *method, gpointer com
                                /* The out wrapper has the same signature as the compiled gsharedvt method */
                                MonoMethodSignature *wrapper_sig = mini_get_gsharedvt_out_sig_wrapper_signature (sig->hasthis, sig->ret->type != MONO_TYPE_VOID, sig->param_count);
 
-                               info->gsharedvt_invoke = TRUE;
                                info->wrapper_arg = mono_method_needs_static_rgctx_invoke (method, TRUE) ? mini_method_get_rgctx (method) : NULL;
 
                                invoke = mono_marshal_get_runtime_invoke_for_sig (wrapper_sig);