[sgen] Fix a card table bug on 64 bits.
commit92e3c595753cd301a12e97e015aabf6dcd2405b3
authorMark Probst <mark.probst@gmail.com>
Tue, 28 Apr 2015 00:31:46 +0000 (27 17:31 -0700)
committerMark Probst <mark.probst@gmail.com>
Tue, 28 Apr 2015 00:42:54 +0000 (27 17:42 -0700)
treef64730448470cc9a0f34477c33bf65b725a99241
parenta4ee723a80c30b09b63431cb6e49aaff2c4cb1d1
[sgen] Fix a card table bug on 64 bits.

When copying value types (like via Array.Copy) it was possible to
encounter a memory region going over the end of the card table array.
In that case we would overwrite data after the card table and fail
to mark cards at the start of the array.

It's hard to do a test case for this because we allocate the shadow card
table directly after the regular one, so the overwrite is benign.  It would
also require allocating very large arrays (>2Gb) and run very slowly.
mono/metadata/sgen-cardtable.c