Skip to content

Commit 722c01b

Browse files
committed
pcre: upgrade to 8.44
1 parent dccfaa4 commit 722c01b

File tree

5 files changed

+26
-25
lines changed

5 files changed

+26
-25
lines changed

deps/pcre/LICENCE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Email domain: cam.ac.uk
2525
University of Cambridge Computing Service,
2626
Cambridge, England.
2727

28-
Copyright (c) 1997-2019 University of Cambridge
28+
Copyright (c) 1997-2020 University of Cambridge
2929
All rights reserved.
3030

3131

@@ -36,7 +36,7 @@ Written by: Zoltan Herczeg
3636
Email local part: hzmester
3737
Email domain: freemail.hu
3838

39-
Copyright(c) 2010-2019 Zoltan Herczeg
39+
Copyright(c) 2010-2020 Zoltan Herczeg
4040
All rights reserved.
4141

4242

@@ -47,7 +47,7 @@ Written by: Zoltan Herczeg
4747
Email local part: hzmester
4848
Email domain: freemail.hu
4949

50-
Copyright(c) 2009-2019 Zoltan Herczeg
50+
Copyright(c) 2009-2020 Zoltan Herczeg
5151
All rights reserved.
5252

5353

deps/pcre/pcre.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
4242
/* The current PCRE version information. */
4343

4444
#define PCRE_MAJOR 8
45-
#define PCRE_MINOR 43
45+
#define PCRE_MINOR 44
4646
#define PCRE_PRERELEASE
47-
#define PCRE_DATE 2019-02-23
47+
#define PCRE_DATE 2020-02-12
4848

4949
#define PCRE_EXP_DECL extern
5050

deps/pcre/pcre_compile.c

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
and semantics are as close as possible to those of the Perl 5 language.
77
88
Written by Philip Hazel
9-
Copyright (c) 1997-2018 University of Cambridge
9+
Copyright (c) 1997-2020 University of Cambridge
1010
1111
-----------------------------------------------------------------------------
1212
Redistribution and use in source and binary forms, with or without
@@ -68,7 +68,7 @@ COMPILE_PCREx macro will already be appropriately set. */
6868

6969
/* Macro for setting individual bits in class bitmaps. */
7070

71-
#define SETBIT(a,b) a[(b)/8] |= (1 << ((b)&7))
71+
#define SETBIT(a,b) a[(b)/8] |= (1U << ((b)&7))
7272

7373
/* Maximum length value to check against when making sure that the integer that
7474
holds the compiled pattern length does not overflow. We make it a bit less than
@@ -129,8 +129,8 @@ overrun before it actually does run off the end of the data block. */
129129

130130
/* Private flags added to firstchar and reqchar. */
131131

132-
#define REQ_CASELESS (1 << 0) /* Indicates caselessness */
133-
#define REQ_VARY (1 << 1) /* Reqchar followed non-literal item */
132+
#define REQ_CASELESS (1U << 0) /* Indicates caselessness */
133+
#define REQ_VARY (1U << 1) /* Reqchar followed non-literal item */
134134
/* Negative values for the firstchar and reqchar flags */
135135
#define REQ_UNSET (-2)
136136
#define REQ_NONE (-1)
@@ -3611,7 +3611,7 @@ for(;;)
36113611
if (chr > 255) break;
36123612
class_bitset = (pcre_uint8 *)
36133613
((list_ptr == list ? code : base_end) - list_ptr[2]);
3614-
if ((class_bitset[chr >> 3] & (1 << (chr & 7))) != 0) return FALSE;
3614+
if ((class_bitset[chr >> 3] & (1U << (chr & 7))) != 0) return FALSE;
36153615
break;
36163616

36173617
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
@@ -7135,17 +7135,19 @@ for (;; ptr++)
71357135
int n = 0;
71367136
ptr++;
71377137
while(IS_DIGIT(*ptr))
7138+
{
71387139
n = n * 10 + *ptr++ - CHAR_0;
7140+
if (n > 255)
7141+
{
7142+
*errorcodeptr = ERR38;
7143+
goto FAILED;
7144+
}
7145+
}
71397146
if (*ptr != CHAR_RIGHT_PARENTHESIS)
71407147
{
71417148
*errorcodeptr = ERR39;
71427149
goto FAILED;
71437150
}
7144-
if (n > 255)
7145-
{
7146-
*errorcodeptr = ERR38;
7147-
goto FAILED;
7148-
}
71497151
*code++ = n;
71507152
PUT(code, 0, (int)(ptr - cd->start_pattern + 1)); /* Pattern offset */
71517153
PUT(code, LINK_SIZE, 0); /* Default length */
@@ -7461,7 +7463,7 @@ for (;; ptr++)
74617463
{
74627464
open_capitem *oc;
74637465
recno = GET2(slot, 0);
7464-
cd->backref_map |= (recno < 32)? (1 << recno) : 1;
7466+
cd->backref_map |= (recno < 32)? (1U << recno) : 1;
74657467
if (recno > cd->top_backref) cd->top_backref = recno;
74667468

74677469
/* Check to see if this back reference is recursive, that it, it
@@ -8072,7 +8074,7 @@ for (;; ptr++)
80728074
item_hwm_offset = cd->hwm - cd->start_workspace;
80738075
*code++ = ((options & PCRE_CASELESS) != 0)? OP_REFI : OP_REF;
80748076
PUT2INC(code, 0, recno);
8075-
cd->backref_map |= (recno < 32)? (1 << recno) : 1;
8077+
cd->backref_map |= (recno < 32)? (1U << recno) : 1;
80768078
if (recno > cd->top_backref) cd->top_backref = recno;
80778079

80788080
/* Check to see if this back reference is recursive, that it, it
@@ -8685,7 +8687,7 @@ do {
86858687
op == OP_SCBRA || op == OP_SCBRAPOS)
86868688
{
86878689
int n = GET2(scode, 1+LINK_SIZE);
8688-
int new_map = bracket_map | ((n < 32)? (1 << n) : 1);
8690+
int new_map = bracket_map | ((n < 32)? (1U << n) : 1);
86898691
if (!is_anchored(scode, new_map, cd, atomcount)) return FALSE;
86908692
}
86918693

@@ -8813,7 +8815,7 @@ do {
88138815
op == OP_SCBRA || op == OP_SCBRAPOS)
88148816
{
88158817
int n = GET2(scode, 1+LINK_SIZE);
8816-
int new_map = bracket_map | ((n < 32)? (1 << n) : 1);
8818+
int new_map = bracket_map | ((n < 32)? (1U << n) : 1);
88178819
if (!is_startline(scode, new_map, cd, atomcount, inassert)) return FALSE;
88188820
}
88198821

deps/pcre/pcre_jit_compile.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3938,10 +3938,10 @@ static sljit_s32 character_to_int32(pcre_uchar chr)
39383938
sljit_s32 value = (sljit_s32)chr;
39393939
#if defined COMPILE_PCRE8
39403940
#define SSE2_COMPARE_TYPE_INDEX 0
3941-
return (value << 24) | (value << 16) | (value << 8) | value;
3941+
return ((unsigned int)value << 24) | ((unsigned int)value << 16) | ((unsigned int)value << 8) | (unsigned int)value;
39423942
#elif defined COMPILE_PCRE16
39433943
#define SSE2_COMPARE_TYPE_INDEX 1
3944-
return (value << 16) | value;
3944+
return ((unsigned int)value << 16) | value;
39453945
#elif defined COMPILE_PCRE32
39463946
#define SSE2_COMPARE_TYPE_INDEX 2
39473947
return value;
@@ -8507,7 +8507,7 @@ if (opcode == OP_ONCE)
85078507
/* We temporarily encode the needs_control_head in the lowest bit.
85088508
Note: on the target architectures of SLJIT the ((x << 1) >> 1) returns
85098509
the same value for small signed numbers (including negative numbers). */
8510-
BACKTRACK_AS(bracket_backtrack)->u.framesize = (BACKTRACK_AS(bracket_backtrack)->u.framesize << 1) | (needs_control_head ? 1 : 0);
8510+
BACKTRACK_AS(bracket_backtrack)->u.framesize = ((unsigned int)BACKTRACK_AS(bracket_backtrack)->u.framesize << 1) | (needs_control_head ? 1 : 0);
85118511
}
85128512
return cc + repeat_length;
85138513
}

deps/pcre/pcreposix.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
and semantics are as close as possible to those of the Perl 5 language.
77
88
Written by Philip Hazel
9-
Copyright (c) 1997-2018 University of Cambridge
9+
Copyright (c) 1997-2020 University of Cambridge
1010
1111
-----------------------------------------------------------------------------
1212
Redistribution and use in source and binary forms, with or without
@@ -287,6 +287,7 @@ if (preg->re_pcre == NULL)
287287
(void)pcre_fullinfo((const pcre *)preg->re_pcre, NULL, PCRE_INFO_CAPTURECOUNT,
288288
&re_nsub);
289289
preg->re_nsub = (size_t)re_nsub;
290+
preg->re_erroffset = (size_t)(-1); /* No meaning after successful compile */
290291
return 0;
291292
}
292293

@@ -324,8 +325,6 @@ if ((eflags & PCRE_REG_NOTBOL) != 0) options |= PCRE_NOTBOL;
324325
if ((eflags & PCRE_REG_NOTEOL) != 0) options |= PCRE_NOTEOL;
325326
if ((eflags & PCRE_REG_NOTEMPTY) != 0) options |= PCRE_NOTEMPTY;
326327

327-
((pcre_regex_t *)preg)->re_erroffset = (size_t)(-1); /* Only has meaning after compile */
328-
329328
/* When no string data is being returned, or no vector has been passed in which
330329
to put it, ensure that nmatch is zero. Otherwise, ensure the vector for holding
331330
the return data is large enough. */

0 commit comments

Comments
 (0)