Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-04-01 18:07:38 +0300
committerGitHub <noreply@github.com>2021-04-01 18:07:38 +0300
commitb46ffbf95ad809993a4cb5599655c309a673b89a (patch)
treee320cfa0dda06f834594021eb7a76d0bb713ba5b /src
parenta9644742271d329526dd78b652d5f4ad317482d9 (diff)
[mono] Fix the handling of jit icall wrappers in mono_aot_method_hash (), the name might be different at runtime if DISABLE_JIT is set. (#50497)
Co-authored-by: Zoltan Varga <vargaz@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/mono/mono/mini/aot-compiler.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c
index 14dd5380ef1..45f084d2c1e 100644
--- a/src/mono/mono/mini/aot-compiler.c
+++ b/src/mono/mono/mini/aot-compiler.c
@@ -10564,7 +10564,11 @@ mono_aot_method_hash (MonoMethod *method)
hashes [0] = mono_metadata_str_hash (m_class_get_name (klass));
hashes [1] = mono_metadata_str_hash (m_class_get_name_space (klass));
}
- hashes [2] = mono_metadata_str_hash (method->name);
+ if (method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE && mono_marshal_get_wrapper_info (method)->subtype == WRAPPER_SUBTYPE_ICALL_WRAPPER)
+ /* The name might not be set correctly if DISABLE_JIT is set */
+ hashes [2] = mono_marshal_get_wrapper_info (method)->d.icall.jit_icall_id;
+ else
+ hashes [2] = mono_metadata_str_hash (method->name);
hashes [3] = method->wrapper_type;
hashes [4] = mono_aot_type_hash (sig->ret);
hindex = 5;