Skip to content

Commit

Permalink
[jit] Unify the handling of 'error' and 'exc' in the llvm-only and no…
Browse files Browse the repository at this point in the history
…n llvm-only runtime invoke code. Fixes #41961.
  • Loading branch information
vargaz committed Sep 6, 2016
1 parent c25829a commit 51a3c93
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions mono/mini/mini-runtime.c
Expand Up @@ -2349,7 +2349,7 @@ mono_llvmonly_runtime_invoke (MonoMethod *method, RuntimeInvokeInfo *info, void

runtime_invoke (NULL, args, exc, info->compiled_method);
if (exc && *exc)
mono_error_set_exception_instance (error, (MonoException*) *exc);
return NULL;

if (sig->ret->type != MONO_TYPE_VOID && info->ret_box_class)
return mono_value_box_checked (domain, info->ret_box_class, retval, error);
Expand Down Expand Up @@ -2533,12 +2533,17 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec
}
#endif

if (mono_llvm_only)
return mono_llvmonly_runtime_invoke (method, info, obj, params, exc, error);
MonoObject *result;

runtime_invoke = (MonoObject *(*)(MonoObject *, void **, MonoObject **, void *))info->runtime_invoke;
if (mono_llvm_only) {
result = mono_llvmonly_runtime_invoke (method, info, obj, params, exc, error);
if (!is_ok (error))
return NULL;
} else {
runtime_invoke = (MonoObject *(*)(MonoObject *, void **, MonoObject **, void *))info->runtime_invoke;

MonoObject *result = runtime_invoke ((MonoObject *)obj, params, exc, info->compiled_method);
result = runtime_invoke ((MonoObject *)obj, params, exc, info->compiled_method);
}
if (catchExcInMonoError && *exc != NULL)
mono_error_set_exception_instance (error, (MonoException*) *exc);
return result;
Expand Down

0 comments on commit 51a3c93

Please sign in to comment.