generated from unoplatform/template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dev/jela/runtime-update2
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |