summaryrefslogtreecommitdiff
path: root/pcre32_ord2utf32.c
diff options
context:
space:
mode:
authorchpe <chpe@2f5784b3-3f2a-0410-8824-cb99058d5e15>2012-10-16 15:55:24 +0000
committerchpe <chpe@2f5784b3-3f2a-0410-8824-cb99058d5e15>2012-10-16 15:55:24 +0000
commit98bc8289115f4ba64457dd085fd77196a70385ef (patch)
tree62ed97ecdde65128988b7af102c93b214ba2e742 /pcre32_ord2utf32.c
parent5503c84d3cbc612ea8dca37c6fdebd2e12370639 (diff)
downloadpcre-98bc8289115f4ba64457dd085fd77196a70385ef.tar.gz
pcre32: Mask out bits >= 22 on 32-bit characters in UTF-32 mode
UTF-32 only uses 21 bits, so the upper bits may be used to store flags etc. To allow passing the unmodified internal buffers to pcre32, make pcre32 mask out those upper bits. TODO: do the same for the JIT compiler, and add tests git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1083 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcre32_ord2utf32.c')
-rw-r--r--pcre32_ord2utf32.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/pcre32_ord2utf32.c b/pcre32_ord2utf32.c
index 8f71e85..b834cf6 100644
--- a/pcre32_ord2utf32.c
+++ b/pcre32_ord2utf32.c
@@ -50,8 +50,6 @@ character value into a UTF32 string. */
#include "pcre_internal.h"
-#define MASK (0x1fffffu)
-
/*************************************************
* Convert character value to UTF-32 *
*************************************************/
@@ -71,7 +69,7 @@ PRIV(ord2utf)(pcre_uint32 cvalue, pcre_uchar *buffer)
{
#ifdef SUPPORT_UTF
-cvalue &= MASK;
+cvalue &= UTF32_MASK;
/* Checking invalid cvalue character, encoded as invalid UTF-32 character */
if ((cvalue & 0xfffff800u) == 0xd800u || cvalue >= 0x110000u)