Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Lapounov <antonl@microsoft.com>2017-05-12 00:49:44 +0300
committerAnton Lapounov <antonl@microsoft.com>2017-05-12 00:49:44 +0300
commit97fc4cd2bc7c3c5dd249328996faad1df1c5376e (patch)
tree0a6ebd61998e1edf59202b61d0770579680d7dae /src/System.Private.CoreLib
parent959998756eb03b29a4379937863419290207ef7f (diff)
Fix marshalling a null Unicode char array as an ANSI char array by value:
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] char[] foo; CR: YZha [tfs-changeset: 1658094]
Diffstat (limited to 'src/System.Private.CoreLib')
-rw-r--r--src/System.Private.CoreLib/src/System/Runtime/InteropServices/PInvokeMarshal.cs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/PInvokeMarshal.cs b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/PInvokeMarshal.cs
index ba965d6b3..2d8b1d0b4 100644
--- a/src/System.Private.CoreLib/src/System/Runtime/InteropServices/PInvokeMarshal.cs
+++ b/src/System.Private.CoreLib/src/System/Runtime/InteropServices/PInvokeMarshal.cs
@@ -519,6 +519,7 @@ namespace System.Runtime.InteropServices
if (managedArray == null)
{
Buffer.ZeroMemory((byte*)pNative, expectedCharCount);
+ return;
}
int lenUnicode = managedArray.Length;