Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mono]mono_runtime_delegate_invoke change to gc unsafe state #62003

Merged
merged 3 commits into from
Nov 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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