[mono] Avoid calling mono_metadata_type_hash () on the container class in mono_generi...
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Tue, 12 Jul 2022 17:55:23 +0000 (12:55 -0500)
committerGitHub <noreply@github.com>
Tue, 12 Jul 2022 17:55:23 +0000 (12:55 -0500)
commit77fb0b2a314a42bc4238a557e75391abaa477304
tree3e1020fe89a67548b7998a700f2dca8137c887e1
parentce7f08e4ab3e3beaa7f4e02f2e8eb209a8626b2b
[mono] Avoid calling mono_metadata_type_hash () on the container class in mono_generic_class_hash (). (#71764)

If a class inherits from a generic instance instantiated with itself, then its possible
for mono_generic_class_hash () to be called while the container class is not fully
initialized yet, i.e. byval_arg.type is 0. This would cause the generic class to change
its hash.

Fixes https://github.com/dotnet/runtime/issues/71424.

Co-authored-by: Zoltan Varga <vargaz@gmail.com>
src/mono/mono/metadata/metadata.c