[runtime] Fixes an abort caused by a TypeLoadException in certain instances
authorJames Venning <jamie.venning@hotmail.com>
Wed, 16 Mar 2016 00:20:36 +0000 (10:20 +1000)
committerJames Venning <jamie.venning@hotmail.com>
Wed, 16 Mar 2016 00:20:36 +0000 (10:20 +1000)
mono/mini/mini-runtime.c

index 9f62e40fd0dcc5ae65759afac63d8547c34ca03b..bb4181859b6caacbb062a1a9ba4a171d40df0d04 100644 (file)
@@ -1893,7 +1893,13 @@ mono_jit_compile_method_with_opt (MonoMethod *method, guint32 opt, MonoException
                        MonoException *tmpEx;
 
                        mono_jit_stats.methods_lookups++;
-                       vtable = mono_class_vtable (domain, method->klass);
+
+                       vtable = mono_class_vtable_full (domain, method->klass, ex == NULL);
+                       if (ex && method->klass->exception_type) {
+                               *ex = mono_class_get_exception_for_failure (method->klass);
+                               return NULL;
+                       }
+
                        g_assert (vtable);
                        tmpEx = mono_runtime_class_init_full (vtable, ex == NULL);
                        if (tmpEx) {