#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)) { \
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)) {
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);