From f8365f7900909a4ee900a1a905c77fe3225bf4ce Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Sat, 6 Sep 2014 00:38:38 -0400 Subject: [PATCH] [gsharedvt] Allow the SIZEOF opcode in gsharedvt code if it doesn't reference a gsharedvt type. Fixes #22711. --- mono/mini/method-to-ir.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mono/mini/method-to-ir.c b/mono/mini/method-to-ir.c index 27f26a14a76..8a52d6a7a23 100644 --- a/mono/mini/method-to-ir.c +++ b/mono/mini/method-to-ir.c @@ -12155,8 +12155,6 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b guint32 val; int ialign; - GSHAREDVT_FAILURE (*ip); - CHECK_STACK_OVF (1); CHECK_OPSIZE (6); token = read32 (ip + 2); @@ -12168,6 +12166,9 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b CHECK_TYPELOAD (klass); mono_class_init (klass); val = mono_type_size (&klass->byval_arg, &ialign); + + if (mini_is_gsharedvt_klass (cfg, klass)) + GSHAREDVT_FAILURE (*ip); } EMIT_NEW_ICONST (cfg, ins, val); *sp++= ins; -- 2.11.4.GIT