From 9ca4e0ee281f868170cd032ba508fa38a27d69a4 Mon Sep 17 00:00:00 2001 From: James Venning Date: Wed, 16 Mar 2016 10:20:36 +1000 Subject: [PATCH] [runtime] Fixes an abort caused by a TypeLoadException in certain instances --- mono/mini/mini-runtime.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mono/mini/mini-runtime.c b/mono/mini/mini-runtime.c index 9f62e40fd0d..bb4181859b6 100644 --- a/mono/mini/mini-runtime.c +++ b/mono/mini/mini-runtime.c @@ -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) { -- 2.25.1