Fix GC for collectible classes (dotnet/coreclr#19892)
authorJan Vorlicek <janvorli@microsoft.com>
Wed, 12 Sep 2018 11:32:31 +0000 (13:32 +0200)
committerGitHub <noreply@github.com>
Wed, 12 Sep 2018 11:32:31 +0000 (13:32 +0200)
commit66c31d7e6fca641a4d8193d3e309446bc973f3be
treedcf926aee0e6ee59567c803435487155f75ad6dc
parent42c7b9bb6e5d9a8499974380f9c3d48e079fb172
Fix GC for collectible classes (dotnet/coreclr#19892)

There is a subtle bug in the GC that causes access violation when a
LoaderAllocator of a collectible class is pushed to the mark stack and
that class also has partial sub-objects. One example is an array of byte
arrays. In that case, the mark stack is supposed to have the reference
to the instance of the class stored right before the related partial
sub-objects references. But due to the bug, the slot where the instance
of the class was expected to be located was not set to anything.

Commit migrated from https://github.com/dotnet/coreclr/commit/cd1f0d9ad32cacd9d2ac2998f368bc196c40754a
src/coreclr/src/gc/gc.cpp