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

[jit] Fix gsharedvt constrained calls to Object.GetType () under netcore. #43729

Merged
merged 2 commits into from
Oct 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/mono/mono/mini/jit-icalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,21 @@ mono_gsharedvt_constrained_call (gpointer mp, MonoMethod *cmethod, MonoClass *kl
gpointer this_arg;
gpointer new_args [16];

#ifdef ENABLE_NETCORE
if (!mono_class_is_ginst (cmethod->klass) && !cmethod->is_inflated) {
MonoVTable *vt;

/* Object.GetType () is an intrinsic under netcore */
g_assertf (!strcmp (cmethod->name, "GetType"), "%s.%s", m_class_get_name (cmethod->klass), cmethod->name);
vt = mono_class_vtable_checked (mono_domain_get (), klass, error);
if (!is_ok (error)) {
mono_error_set_pending_exception (error);
return NULL;
}
return vt->type;
}
#endif

m = constrained_gsharedvt_call_setup (mp, cmethod, klass, &this_arg, error);
if (!is_ok (error)) {
mono_error_set_pending_exception (error);
Expand Down