Fix an assert in the gsharedvt code.
authorZoltan Varga <vargaz@gmail.com>
Tue, 12 Feb 2013 05:51:10 +0000 (06:51 +0100)
committerZoltan Varga <vargaz@gmail.com>
Tue, 12 Feb 2013 06:41:15 +0000 (07:41 +0100)
mono/mini/method-to-ir.c

index 782a3ff893e1a252e24d9b9d9ceef5ce90afdcc3..9d9cc73b063e65368c83f9e34b1bbe93506b224b 100644 (file)
@@ -8987,10 +8987,11 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                MonoInst *obj, *addr, *klass_inst, *args[16];
                                int dreg;
 
-                               obj = *sp;
-
                                /* Need to check for nullable types at runtime, but those are disabled in mini_is_gsharedvt_sharable_method*/
-                               g_assert (!mono_class_is_nullable (klass));
+                               if (mono_class_is_nullable (klass))
+                                       GSHAREDVT_FAILURE (*ip);
+
+                               obj = *sp;
 
                                klass_inst = emit_get_rgctx_klass (cfg, context_used, klass, MONO_RGCTX_INFO_KLASS);