Merge pull request #2454 from tastywheattasteslikechicken/FixVtableAbort
[mono.git] / mono / mini / mini-runtime.c
index 6a9f054864b68efb5c4915a9b234c442443ec58e..136239a1211c7c217c32221e20bcd5faccc72aa4 100644 (file)
@@ -2007,7 +2007,13 @@ mono_jit_compile_method_with_opt (MonoMethod *method, guint32 opt, MonoError *er
                        MonoVTable *vtable;
 
                        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);
                        if (!mono_runtime_class_init_full (vtable, error))
                                return NULL;