Fix encoding methods for Span.Empty (#16748)
authorJan Kotas <jkotas@microsoft.com>
Mon, 5 Mar 2018 04:05:50 +0000 (20:05 -0800)
committerGitHub <noreply@github.com>
Mon, 5 Mar 2018 04:05:50 +0000 (20:05 -0800)
commita9a0bc658f7808ba7816c6c3658ba965b50667ed
tree6fd0be352c05ea6feca64bee5e1ff64acdd1db9f
parent6613ec75c251dfff265e0f8bfc5d453bdf0e48e7
Fix encoding methods for Span.Empty (#16748)

* Fix encoding methods for Span.Empty

Encoding had a historic confusion about handling null pointers. Make sure that this confusion is not leaking into the new Span methods.

* Use GetNonNullPinnableReference helper method
src/mscorlib/shared/System/Runtime/InteropServices/MemoryMarshal.Fast.cs
src/mscorlib/shared/System/Text/Decoder.cs
src/mscorlib/shared/System/Text/Encoder.cs
src/mscorlib/shared/System/Text/Encoding.cs