[Pcre-svn] [1118] code/trunk: pcre32: Remove masking from UT…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [1118] code/trunk: pcre32: Remove masking from UTF-32 validation
Revision: 1118
          http://vcs.pcre.org/viewvc?view=rev&revision=1118
Author:   chpe
Date:     2012-10-16 16:57:31 +0100 (Tue, 16 Oct 2012)


Log Message:
-----------
pcre32: Remove masking from UTF-32 validation

It's now required and documented that to pass character strings with high bits
set (which will be masked off), it's necessary to pass PCRE_NO_UTF32_CHECK.

Modified Paths:
--------------
    code/trunk/pcre32_valid_utf32.c
    code/trunk/pcretest.c


Modified: code/trunk/pcre32_valid_utf32.c
===================================================================
--- code/trunk/pcre32_valid_utf32.c    2012-10-16 15:57:27 UTC (rev 1117)
+++ code/trunk/pcre32_valid_utf32.c    2012-10-16 15:57:31 UTC (rev 1118)
@@ -93,7 +93,7 @@


for (p = string; length-- > 0; p++)
{
- c = *p & UTF32_MASK;
+ c = *p;

   if ((c & 0xfffff800u) != 0xd800u)
     {


Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c    2012-10-16 15:57:27 UTC (rev 1117)
+++ code/trunk/pcretest.c    2012-10-16 15:57:31 UTC (rev 1118)
@@ -4627,6 +4627,7 @@
       for (q32 = (pcre_uint32 *)dbuffer; *q32; q32++)
         *q32 |= ~(pcre_uint32)UTF32_MASK;


+      /* Need to pass NO_UTF32_CHECK so the high bits are allowed */
       options |= PCRE_NO_UTF32_CHECK;
       }
 #endif