From 1f383813f98f8fab484ed14f21bb4b5a5545adcc Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Wed, 23 May 2012 21:43:45 +0200 Subject: [PATCH] Improve type load errors thrown by the JIT a bit. --- mono/mini/method-to-ir.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mono/mini/method-to-ir.c b/mono/mini/method-to-ir.c index 5b1dbc2e59e..7ebb9faf169 100644 --- a/mono/mini/method-to-ir.c +++ b/mono/mini/method-to-ir.c @@ -348,6 +348,8 @@ mono_create_helper_signatures (void) #define LOAD_ERROR do { if (mini_get_debug_options ()->break_on_unverified) G_BREAKPOINT (); else goto load_error; } while (0) +#define TYPE_LOAD_ERROR(klass) do { if (mini_get_debug_options ()->break_on_unverified) G_BREAKPOINT (); else { cfg->exception_ptr = klass; goto load_error; } } while (0) + #define GET_BBLOCK(cfg,tblock,ip) do { \ (tblock) = cfg->cil_offset_to_bb [(ip) - cfg->cil_start]; \ if (!(tblock)) { \ @@ -6794,7 +6796,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b if (!cmethod->klass->inited) if (!mono_class_init (cmethod->klass)) - LOAD_ERROR; + TYPE_LOAD_ERROR (cmethod->klass); if (cmethod->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL && mini_class_is_system_array (cmethod->klass)) { @@ -8159,7 +8161,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b mono_save_token_info (cfg, image, token, cmethod); if (!mono_class_init (cmethod->klass)) - LOAD_ERROR; + TYPE_LOAD_ERROR (cmethod->klass); if (cfg->generic_sharing_context) context_used = mono_method_check_context_used (cmethod); -- 2.25.1