[metadata] Identify when a field is overlapped by a non-object field (#34745)
authormonojenkins <jo.shields+jenkins@xamarin.com>
Wed, 15 Apr 2020 16:09:03 +0000 (12:09 -0400)
committerGitHub <noreply@github.com>
Wed, 15 Apr 2020 16:09:03 +0000 (13:09 -0300)
commit1cfccd2a7937117341b256847e613dd710a70adb
treeb15b7f39f930590954a0b4c89112de24f77cb03b
parentbbc65f5fa3ac9593c3f93b0901187be0da850d89
[metadata] Identify when a field is overlapped by a non-object field (#34745)

- Fix class loader to identify when the class has a field overlapped by a non-object field.
- Fix method-to-ir to forward the TypeLoad error.
- Fix transform to forward the TypeLoad error.
- Fix unit test that has a class with a field that is overlapped by a non-object field.

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

Co-authored-by: thaystg <thaystg@users.noreply.github.com>
src/mono/mono/metadata/class-init.c
src/mono/mono/mini/interp/transform.c
src/mono/mono/mini/method-to-ir.c
src/mono/mono/tests/sgen-toggleref.cs