Skip to content

Commit e7de9ae

Browse files
committed
Change READ_CHAR_MAX to maximum unsigned value
Also fix range computation when xclass is NOT in eclass.
1 parent b93269d commit e7de9ae

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/pcre2_jit_char_inc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ if (category_list == UCPCAT_ALL)
639639
if (*cc != XCL_END)
640640
{
641641
#if defined SUPPORT_UNICODE && (PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16)
642-
if (common->utf && compares == 0 && (status & XCLASS_IS_ECLASS))
642+
if (common->utf && compares == 0 && !(status & XCLASS_IS_ECLASS))
643643
{
644644
max = 0;
645645
min = (ccbegin[-1] & XCL_MAP) != 0 ? 0 : READ_CHAR_MAX;
@@ -1080,7 +1080,7 @@ if (ranges.stack == NULL)
10801080
defined SUPPORT_UNICODE && (PCRE2_CODE_UNIT_WIDTH == 8 || PCRE2_CODE_UNIT_WIDTH == 16)
10811081
if (common->utf)
10821082
{
1083-
min = 0xffffffff;
1083+
min = READ_CHAR_MAX;
10841084
max = 0;
10851085
xclass_update_min_max(common, cc, &min, &max);
10861086
SLJIT_ASSERT(ranges.ranges[0] == min && ranges.ranges[ranges.range_count - 1] == max);

src/pcre2_jit_compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ the start pointers when the end of the capturing group has not yet reached. */
675675
#define GET_LOCAL_BASE(dst, dstw, offset) \
676676
sljit_get_local_base(compiler, (dst), (dstw), (offset))
677677

678-
#define READ_CHAR_MAX 0x7fffffff
678+
#define READ_CHAR_MAX ((sljit_u32)0xffffffff)
679679

680680
#define INVALID_UTF_CHAR -1
681681
#define UNASSIGNED_UTF_CHAR 888

0 commit comments

Comments
 (0)