Skip to content

Commit

Permalink
[mono][aot] Avoid prefer-ing gsharedvt versions of AsyncMethodBuilder…
Browse files Browse the repository at this point in the history
…Core etc. methods in profile-only mode. (#87990)

The gsharedvt versions might not be generated if they are not in the profile, leading to crashes
at runtime.

Fixes #87856.
  • Loading branch information
vargaz authored Jul 10, 2023
1 parent b99a4dc commit 9b37c98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mono/mono/mini/aot-compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -4300,7 +4300,7 @@ static gboolean
prefer_gsharedvt_method (MonoAotCompile *acfg, MonoMethod *method)
{
/* One instantiation with valuetypes is generated for each async method */
if (m_class_get_image (method->klass) == mono_defaults.corlib && (!strcmp (m_class_get_name (method->klass), "AsyncMethodBuilderCore") || !strcmp (m_class_get_name (method->klass), "AsyncVoidMethodBuilder")))
if (!acfg->aot_opts.profile_only && m_class_get_image (method->klass) == mono_defaults.corlib && (!strcmp (m_class_get_name (method->klass), "AsyncMethodBuilderCore") || !strcmp (m_class_get_name (method->klass), "AsyncVoidMethodBuilder")))
return TRUE;
else
return FALSE;
Expand Down

0 comments on commit 9b37c98

Please sign in to comment.