static guint32*
emit_call (MonoCompile *cfg, guint32 *code, guint32 patch_type, gconstpointer data)
{
+ MonoError error;
gpointer target;
/* FIXME: This only works if the target method is already compiled */
patch_info.type = patch_type;
patch_info.data.target = data;
- target = mono_resolve_patch_target (cfg->method, cfg->domain, NULL, &patch_info, FALSE);
+ target = mono_resolve_patch_target (cfg->method, cfg->domain, NULL, &patch_info, FALSE, &error);
+ mono_error_raise_exception (&error); /* FIXME: don't raise here */
/* FIXME: Add optimizations if the target is close enough */
sparc_set (code, target, sparc_o7);
sparc_srl_imm (code, sparc_o7, 4, sparc_o7);
sparc_and_imm (code, FALSE, sparc_o7, 2047, sparc_o7);
sparc_cmp_imm (code, sparc_o7, 2047);
- EMIT_COND_SYSTEM_EXCEPTION (ins, sparc_be, "ArithmeticException");
+ EMIT_COND_SYSTEM_EXCEPTION (ins, sparc_be, "OverflowException");
#ifdef SPARCV9
sparc_fmovd (code, ins->sreg1, ins->dreg);
#else
void
mono_arch_patch_code (MonoCompile *cfg, MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *ji, gboolean run_cctors)
{
+ MonoError error;
MonoJumpInfo *patch_info;
/* FIXME: Move part of this to arch independent code */
unsigned char *ip = patch_info->ip.i + code;
gpointer target;
- target = mono_resolve_patch_target (method, domain, code, patch_info, run_cctors);
+ target = mono_resolve_patch_target (method, domain, code, patch_info, run_cctors, &error);
+ mono_error_raise_exception (&error); /* FIXME: don't raise here */
switch (patch_info->type) {
case MONO_PATCH_INFO_NONE:
sparc_patch ((guint32*)(cfg->native_code + patch_info->ip.i), code);
- exc_class = mono_class_from_name (mono_defaults.corlib, "System", patch_info->data.name);
- g_assert (exc_class);
+ exc_class = mono_class_load_from_name (mono_defaults.corlib, "System", patch_info->data.name);
type_idx = exc_class->type_token - MONO_TOKEN_TYPE_DEF;
throw_ip = patch_info->ip.i;