Fix marshalling a pinnable multi-dimensional array via a P/Inv… (dotnet/coreclr#26279)
authorJeremy Koritzinsky <jekoritz@microsoft.com>
Tue, 27 Aug 2019 22:13:03 +0000 (15:13 -0700)
committerGitHub <noreply@github.com>
Tue, 27 Aug 2019 22:13:03 +0000 (15:13 -0700)
commited5038775e8cec76499ff023cdb43a2c48b9ef0d
treecfc96a28cdd0007a2ebbda916ad13678dde9284c
parente0c201c9487d7bb82db8ba7f64ce65409873a490
Fix marshalling a pinnable multi-dimensional array via a P/Inv… (dotnet/coreclr#26279)

* Use the exact methodtable of the parameter to calculate the offset into a pinned array.

* Fix logic check.

* Update precondition.

* Fix accidental union overlap.

Commit migrated from https://github.com/dotnet/coreclr/commit/f43185b07889fabb2e07c8fe4c1dfcd74f17747c
src/coreclr/src/vm/ilmarshalers.cpp
src/coreclr/src/vm/mlinfo.cpp
src/coreclr/src/vm/mlinfo.h
src/coreclr/tests/src/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs
src/coreclr/tests/src/Interop/PInvoke/Array/MarshalArrayAsParam/LPArrayNative/MarshalArrayLPArrayNative.cpp