[mono] Fix the handling of jit icall wrappers in mono_aot_method_hash (), the name...
authorZoltan Varga <vargaz@gmail.com>
Wed, 31 Mar 2021 17:21:16 +0000 (13:21 -0400)
committerGitHub <noreply@github.com>
Wed, 31 Mar 2021 17:21:16 +0000 (13:21 -0400)
src/mono/mono/mini/aot-compiler.c

index c75493a..c602e4a 100644 (file)
@@ -10574,7 +10574,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;