Revision: 1373
http://vcs.pcre.org/viewvc?view=rev&revision=1373
Author: chpe
Date: 2013-10-12 15:54:53 +0100 (Sat, 12 Oct 2013)
Log Message:
-----------
Fix \o{...} to accept characters between 0x80000000 and 0xffffffff
The 32-bit library in non-UTF-32 mode can accept any 32-bit character, not
just up to 0x7fffffff.
Modified Paths:
--------------
code/trunk/doc/pcrepattern.3
code/trunk/pcre_compile.c
code/trunk/testdata/testinput25
code/trunk/testdata/testoutput25
Modified: code/trunk/doc/pcrepattern.3
===================================================================
--- code/trunk/doc/pcrepattern.3 2013-10-11 17:05:19 UTC (rev 1372)
+++ code/trunk/doc/pcrepattern.3 2013-10-12 14:54:53 UTC (rev 1373)
@@ -414,7 +414,7 @@
8-bit UTF-8 mode less than 0x10ffff and a valid codepoint
16-bit non-UTF mode less than 0x10000
16-bit UTF-16 mode less than 0x10ffff and a valid codepoint
- 32-bit non-UTF mode less than 0x80000000
+ 32-bit non-UTF mode less than 0x100000000
32-bit UTF-32 mode less than 0x10ffff and a valid codepoint
.sp
Invalid Unicode codepoints are the range 0xd800 to 0xdfff (the so-called
Modified: code/trunk/pcre_compile.c
===================================================================
--- code/trunk/pcre_compile.c 2013-10-11 17:05:19 UTC (rev 1372)
+++ code/trunk/pcre_compile.c 2013-10-12 14:54:53 UTC (rev 1373)
@@ -1181,7 +1181,7 @@
register pcre_uint32 cc = *ptr++;
if (c == 0 && cc == CHAR_0) continue; /* Leading zeroes */
#ifdef COMPILE_PCRE32
- if (c >= 0x10000000l) { overflow = TRUE; break; }
+ if (c >= 0x20000000l) { overflow = TRUE; break; }
#endif
c = (c << 3) + cc - CHAR_0 ;
#if defined COMPILE_PCRE8
Modified: code/trunk/testdata/testinput25
===================================================================
--- code/trunk/testdata/testinput25 2013-10-11 17:05:19 UTC (rev 1372)
+++ code/trunk/testdata/testinput25 2013-10-12 14:54:53 UTC (rev 1373)
@@ -10,6 +10,16 @@
/\x{ffffffff}/
+/\x{100000000}/
+
+/\o{17777777777}/
+
+/\o{20000000000}/
+
+/\o{37777777777}/
+
+/\o{40000000000}/
+
/\x{7fffffff}\x{7fffffff}/I
/\x{80000000}\x{80000000}/I
Modified: code/trunk/testdata/testoutput25
===================================================================
--- code/trunk/testdata/testoutput25 2013-10-11 17:05:19 UTC (rev 1372)
+++ code/trunk/testdata/testoutput25 2013-10-12 14:54:53 UTC (rev 1373)
@@ -10,6 +10,18 @@
/\x{ffffffff}/
+/\x{100000000}/
+Failed: character value in \x{} or \o{} is too large at offset 12
+
+/\o{17777777777}/
+
+/\o{20000000000}/
+
+/\o{37777777777}/
+
+/\o{40000000000}/
+Failed: character value in \x{} or \o{} is too large at offset 14
+
/\x{7fffffff}\x{7fffffff}/I
Capturing subpattern count = 0
No options