[mono] Don't save byref `System.Void` into `MonoDomain::typeof_void`. (#40405)
authorimhameed <imhameed@microsoft.com>
Thu, 6 Aug 2020 00:49:12 +0000 (17:49 -0700)
committerGitHub <noreply@github.com>
Thu, 6 Aug 2020 00:49:12 +0000 (17:49 -0700)
commit1a39b6c63dbc12721348281bd591ef5a8d75b4ae
treefd77bb89a1bfe1fb1a291a1cbc28325c6980ba33
parentc8ecf5519c5eaba24419a41aabad1eaca0437558
[mono] Don't save byref `System.Void` into `MonoDomain::typeof_void`. (#40405)

`mono_type_get_object_checked` will return the `MonoReflectionType`
referred to by `MonoDomain::typeof_void` if present. If a byref
`System.Void` is stored in this field, then
`get_ContainsGenericParameters` applied to `System.Void` will loop
indefinitely, because our implementation of
`get_ContainsGenericParameters` expects `GetElementType` to yield a
`MonoReflectionType` with one layer of "type function application"
removed.

Fixes https://github.com/dotnet/runtime/issues/37489.
src/mono/mono/metadata/reflection.c