summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLevi Broderick <levib@microsoft.com>2019-04-11 15:36:47 -0700
committerLevi Broderick <levib@microsoft.com>2019-04-11 15:36:47 -0700
commite307d1462e5a279f90d43fdf78be25f7f6092f1c (patch)
tree36227eabb73d9a8a9bb649038cdd2cff2d938e0f /src
parent0adca8ba3c0ba1deb6f47848e9536c3a8d51edff (diff)
downloadcoreclr-e307d1462e5a279f90d43fdf78be25f7f6092f1c.tar.gz
coreclr-e307d1462e5a279f90d43fdf78be25f7f6092f1c.tar.bz2
coreclr-e307d1462e5a279f90d43fdf78be25f7f6092f1c.zip
Clarify comment in 3-byte processing
Diffstat (limited to 'src')
-rw-r--r--src/System.Private.CoreLib/shared/System/Text/Unicode/Utf8Utility.Transcoding.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Text/Unicode/Utf8Utility.Transcoding.cs b/src/System.Private.CoreLib/shared/System/Text/Unicode/Utf8Utility.Transcoding.cs
index 3f00ede14c..3b83a24559 100644
--- a/src/System.Private.CoreLib/shared/System/Text/Unicode/Utf8Utility.Transcoding.cs
+++ b/src/System.Private.CoreLib/shared/System/Text/Unicode/Utf8Utility.Transcoding.cs
@@ -506,8 +506,8 @@ namespace System.Text.Unicode
if (outputCharsRemaining > 1 && (nint)(void*)Unsafe.ByteOffset(ref *pInputBuffer, ref *pFinalPosWhereCanReadDWordFromInputBuffer) >= 3)
{
// We're going to attempt to read a second 3-byte sequence and write them both out simultaneously using PEXT.
- // Since we already validated the first byte of the second DWORD (it's the same as the final byte of the
- // first DWORD), the only checks that remain are the overlong + surrogate checks. If the overlong or surrogate
+ // We need to check the continuation bit mask on the remaining two bytes (and we may as well check the leading
+ // byte mask again since it's free), then perform overlong + surrogate checks. If the overlong or surrogate
// checks fail, we'll fall through to the remainder of the logic which will transcode the original valid
// 3-byte UTF-8 sequence we read; and on the next iteration of the loop the validation routine will run again,
// fail, and redirect control flow to the error handling logic at the very end of this method.