Add logic to object array typecheck to handle arrays of unmanaged pointers (#14733)
commita5a26a2f92d00ab174d794f077007faaab5d3843
authorRyan Lucia <rylucia@microsoft.com>
Thu, 6 Jun 2019 19:38:57 +0000 (6 15:38 -0400)
committerGitHub <noreply@github.com>
Thu, 6 Jun 2019 19:38:57 +0000 (6 15:38 -0400)
treebdb88a5dc773e4545033457626beb5539feef521
parent6d2c77fb3373971b4c615a70fe43f3622e3c91d8
Add logic to object array typecheck to handle arrays of unmanaged pointers (#14733)

Fixes #14555

The NULL check alone is not enough, because interfaces are also parented to NULL for some reason, and so I've moved `class_kind` out from the bitfield section to make it accessible from IR. The beginning of the struct is going to be padded to 32 bits anyway at the least, so this move should save space if anything.

Our type checking overall is not very robust, and in particular the supertype comparison doesn't work well for anything that isn't an object, so it's possible there are some other weird corner cases. As far as I can tell looking through the array of objects stuff though, we should have reasonable coverage with the existing tests + the stuff I added.
mono/metadata/class-getters.h
mono/metadata/class-internals.h
mono/metadata/class-private-definition.h
mono/metadata/class.c
mono/metadata/object-offsets.h
mono/mini/objects.cs
mono/mini/type-checking.c
mono/tests/assignable-tests.cs