File tree Expand file tree Collapse file tree 5 files changed +27
-5
lines changed Expand file tree Collapse file tree 5 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -174,10 +174,14 @@ undefined behaviour.
174
174
that its end is handled similarly to other recursions. This has altered the
175
175
behaviour of /|(?0)./endanchored which was previously not right.
176
176
177
- 48. Improved the test for looping recursion by checking the last referenced
178
- character as well as the current character. This allows some patterns that
179
- previously triggered the check to run to completion instead of giving the loop
180
- error.
177
+ 48. Improved the test for looping recursion by checking the last referenced
178
+ character as well as the current character. This allows some patterns that
179
+ previously triggered the check to run to completion instead of giving the loop
180
+ error.
181
+
182
+ 49. In 32-bit mode, the compiler looped for the pattern /[\x{ffffffff}]/ when
183
+ PCRE2_CASELESS and PCRE2_UCP (but not PCRE2_UTF) were set. Fixed by not trying
184
+ to look for other cases for characters above the Unicode range.
181
185
182
186
183
187
Version 10.42 11-December-2022
Original file line number Diff line number Diff line change @@ -5155,10 +5155,14 @@ unsigned int co;
5155
5155
5156
5156
/* Find the first character that has an other case. If it has multiple other
5157
5157
cases, return its case offset value. When CASELESS_RESTRICT is set, ignore the
5158
- multi-case entries that begin with ASCII values. */
5158
+ multi-case entries that begin with ASCII values. In 32-bit mode, a value
5159
+ greater than the Unicode maximum ends the range. */
5159
5160
5160
5161
for (c = * cptr ; c <= d ; c ++ )
5161
5162
{
5163
+ #if PCRE2_CODE_UNIT_WIDTH == 32
5164
+ if (c > MAX_UTF_CODE_POINT ) return -1 ;
5165
+ #endif
5162
5166
if ((co = UCD_CASESET (c )) != 0 &&
5163
5167
(!restricted || PRIV (ucd_caseless_sets )[co ] > 127 ))
5164
5168
{
Original file line number Diff line number Diff line change 573
573
/\X++/
574
574
a\x{110000}\x{ffffffff}
575
575
576
+ # This used to loop in 32-bit mode; it will fail in 16-bit mode.
577
+ /[\x{ffffffff}]/caseless,ucp
578
+ \x{ffffffff}xyz
579
+
576
580
# End of testinput12
Original file line number Diff line number Diff line change @@ -1823,4 +1823,9 @@ Failed: error 134 at offset 11: character code point value in \x{} or \o{} is to
1823
1823
** Truncation will probably give the wrong result.
1824
1824
0: a\x00\x{ffff}
1825
1825
1826
+ # This used to loop in 32-bit mode; it will fail in 16-bit mode.
1827
+ /[\x{ffffffff}]/caseless,ucp
1828
+ Failed: error 134 at offset 12: character code point value in \x{} or \o{} is too large
1829
+ \x{ffffffff}xyz
1830
+
1826
1831
# End of testinput12
Original file line number Diff line number Diff line change @@ -1817,4 +1817,9 @@ No match
1817
1817
a\x{110000}\x{ffffffff}
1818
1818
0: a\x{110000}\x{ffffffff}
1819
1819
1820
+ # This used to loop in 32-bit mode; it will fail in 16-bit mode.
1821
+ /[\x{ffffffff}]/caseless,ucp
1822
+ \x{ffffffff}xyz
1823
+ 0: \x{ffffffff}
1824
+
1820
1825
# End of testinput12
You can’t perform that action at this time.
0 commit comments