Issue reported in https://github.com/dotnet/corefx/issues/31456
Solution is to compare always against IntPtr.Zero and use Roslyn
stric mode for reporting warnings for IntPtr == null comparisons
Commit migrated from https://github.com/dotnet/coreclr/commit/
93cf012db8396f5ea16f70b781a5de0d012fc65d
<PropertyGroup>
<CL_MPCount>$(NumberOfCores)</CL_MPCount>
</PropertyGroup>
+ <PropertyGroup>
+ <!-- Enables Strict mode for Roslyn compiler -->
+ <Features>strict</Features>
+ </PropertyGroup>
</Project>
internal static unsafe void ConvertToManaged(StringBuilder sb, IntPtr pNative)
{
- if (pNative == null)
+ if (pNative == IntPtr.Zero)
return;
int nbBytes = StubHelpers.strlen((sbyte*)pNative);