Skip to content

Commit

Permalink
[mono]mono_runtime_delegate_invoke change to gc unsafe state (#62003)
Browse files Browse the repository at this point in the history
* mono_runtime_delegate_invoke wrapper with MONO_ENTER_GC_UNSAFE/MONO_EXIT_GC_UNSAFE;

mono_runtime_delegate_invoke wrapper with MONO_ENTER_GC_UNSAFE/MONO_EXIT_GC_UNSAFE;

* Update object.c
  • Loading branch information
srxqds committed Nov 29, 2021
1 parent 12a8819 commit a4cab7d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/mono/mono/metadata/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -3714,24 +3714,25 @@ mono_get_delegate_end_invoke_checked (MonoClass *klass, MonoError *error)
MonoObject*
mono_runtime_delegate_invoke (MonoObject *delegate, void **params, MonoObject **exc)
{
MONO_REQ_GC_UNSAFE_MODE;

ERROR_DECL (error);
MonoObject* result = NULL;
MONO_ENTER_GC_UNSAFE;
if (exc) {
MonoObject *result = mono_runtime_delegate_try_invoke (delegate, params, exc, error);
result = mono_runtime_delegate_try_invoke (delegate, params, exc, error);
if (*exc) {
mono_error_cleanup (error);
return NULL;
result = NULL;
} else {
if (!is_ok (error))
*exc = (MonoObject*)mono_error_convert_to_exception (error);
return result;
}
} else {
MonoObject *result = mono_runtime_delegate_invoke_checked (delegate, params, error);
result = mono_runtime_delegate_invoke_checked (delegate, params, error);
mono_error_raise_exception_deprecated (error); /* OK to throw, external only without a good alternative */
return result;

}
MONO_EXIT_GC_UNSAFE;
return result;
}

/**
Expand Down

0 comments on commit a4cab7d

Please sign in to comment.