[mono] Fix comparisons between non runtime types (#54062)
authorVlad Brezae <brezaevlad@gmail.com>
Thu, 17 Jun 2021 08:40:36 +0000 (11:40 +0300)
committerGitHub <noreply@github.com>
Thu, 17 Jun 2021 08:40:36 +0000 (11:40 +0300)
commit96a4671bc52e70024da409f5f48b0abaa30cb901
treec0ed70d81b602786b9c8edc2ec0e78a5b4898efa
parent33cf378f50b4a29ae4f2400831c76e8eb5d88ba8
[mono] Fix comparisons between non runtime types (#54062)

* [interp] Fix comparisons between non runtime types

We know that the result of object.GetType and ldftn + GetTypeFromHandle are runtime types and we track it on the compilation stack. If type equality operator is applied on two runtime types we use reference equality comparison, otherwise we use the managed implementation which uses Type.Equals.

* [mini] Fix comparisons between non runtime types

We know that the result of object.GetType and ldftn + GetTypeFromHandle are runtime types and we track it on the compilation stack. If type equality operator is applied on two runtime types we use reference equality comparison, otherwise we use the managed implementation which uses Type.Equals.

* [interp] Resolve GetType on constrained valuetype to the actual type
src/mono/System.Private.CoreLib/src/System/Type.Mono.cs
src/mono/mono/mini/interp/transform.c
src/mono/mono/mini/intrinsics.c
src/mono/mono/mini/method-to-ir.c
src/mono/mono/mini/mini.h