[jit] Avoid asserting on Unsafe.As<T> in gsharedvt methods.
authorZoltan Varga <vargaz@gmail.com>
Sat, 3 Aug 2019 19:06:55 +0000 (15:06 -0400)
committerZoltan Varga <vargaz@gmail.com>
Sat, 3 Aug 2019 19:06:58 +0000 (15:06 -0400)
Fixes https://github.com/mono/mono/issues/15992.

Commit migrated from https://github.com/mono/mono/commit/60bfa99043e0112a4d30ebccd5c9f800d0cc101a

src/mono/mono/mini/intrinsics.c

index 9da5a5a..79b2197 100644 (file)
@@ -268,6 +268,9 @@ emit_unsafe_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignatu
                g_assert (ctx);
                g_assert (ctx->method_inst);
 
+               t = ctx->method_inst->type_argv [0];
+               if (mini_is_gsharedvt_variable_type (t))
+                       return NULL;
                if (ctx->method_inst->type_argc == 2) {
                        dreg = alloc_preg (cfg);
                        EMIT_NEW_UNALU (cfg, ins, OP_MOVE, dreg, args [0]->dreg);