Skip to content

Commit

Permalink
Merge branch 'master' into dev/jela/runtime-update2
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Aug 14, 2023
2 parents 81b402a + 7224aa4 commit ca26e20
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions patches/0014-PR87990.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From de176636a5d51c549265bbd8e2567d3ac4be5b58 Mon Sep 17 00:00:00 2001
From: Zoltan Varga <[email protected]>
Date: Fri, 23 Jun 2023 19:13:16 -0400
Subject: [PATCH] [mono][aot] Avoid prefer-ing gsharedvt versions of
AsyncMethodBuilderCore etc. methods in profile-only mode.

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

Fixes https://github.com/dotnet/runtime/issues/87856.
---
src/mono/mono/mini/aot-compiler.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c
index 6b8621175b262..0f95bde02bc40 100644
--- a/src/mono/mono/mini/aot-compiler.c
+++ b/src/mono/mono/mini/aot-compiler.c
@@ -4299,7 +4299,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;

0 comments on commit ca26e20

Please sign in to comment.