Skip to content

Commit d918e07

Browse files
committed
Upgrade PCRE2 to 10.32
1 parent 4f36acb commit d918e07

36 files changed

+4870
-4038
lines changed

ext/pcre/pcre2lib/pcre2.h

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* This is the public header file for the PCRE library, second API, to be
66
#included by applications that call PCRE2 functions.
77
8-
Copyright (c) 2016-2017 University of Cambridge
8+
Copyright (c) 2016-2018 University of Cambridge
99
1010
-----------------------------------------------------------------------------
1111
Redistribution and use in source and binary forms, with or without
@@ -41,10 +41,16 @@ POSSIBILITY OF SUCH DAMAGE.
4141

4242
/* The current PCRE version information. */
4343

44-
#define PCRE2_MAJOR 10
45-
#define PCRE2_MINOR 31
46-
#define PCRE2_PRERELEASE
47-
#define PCRE2_DATE 2018-02-12
44+
#define PCRE2_MAJOR 10
45+
#define PCRE2_MINOR 32
46+
#define PCRE2_PRERELEASE
47+
#define PCRE2_DATE 2018-09-10
48+
49+
/* For the benefit of systems without stdint.h, an alternative is to use
50+
inttypes.h. The existence of these headers is checked by configure or CMake. */
51+
52+
#define PCRE2_HAVE_STDINT_H 1
53+
#define PCRE2_HAVE_INTTYPES_H 1
4854

4955
/* When an application links to a PCRE DLL in Windows, the symbols that are
5056
imported have to be identified as such. When building PCRE2, the appropriate
@@ -81,12 +87,18 @@ set, we ensure here that it has no effect. */
8187
#define PCRE2_CALL_CONVENTION
8288
#endif
8389

84-
/* Have to include limits.h, stdlib.h and stdint.h to ensure that size_t and
85-
uint8_t, UCHAR_MAX, etc are defined. */
90+
/* Have to include limits.h, stdlib.h and stdint.h (or inttypes.h) to ensure
91+
that size_t and uint8_t, UCHAR_MAX, etc are defined. If the system has neither
92+
header, the relevant values must be provided by some other means. */
8693

8794
#include <limits.h>
8895
#include <stdlib.h>
96+
97+
#if PCRE2_HAVE_STDINT_H
8998
#include <stdint.h>
99+
#elif PCRE2_HAVE_INTTYPES_H
100+
#include <inttypes.h>
101+
#endif
90102

91103
/* Allow for C++ users compiling this directly. */
92104

@@ -269,6 +281,7 @@ pcre2_pattern_convert(). */
269281
#define PCRE2_ERROR_INTERNAL_UNKNOWN_NEWLINE 156
270282
#define PCRE2_ERROR_BACKSLASH_G_SYNTAX 157
271283
#define PCRE2_ERROR_PARENS_QUERY_R_MISSING_CLOSING 158
284+
/* Error 159 is obsolete and should now never occur */
272285
#define PCRE2_ERROR_VERB_ARGUMENT_NOT_ALLOWED 159
273286
#define PCRE2_ERROR_VERB_UNKNOWN 160
274287
#define PCRE2_ERROR_SUBPATTERN_NUMBER_TOO_BIG 161
@@ -303,6 +316,8 @@ pcre2_pattern_convert(). */
303316
#define PCRE2_ERROR_INTERNAL_BAD_CODE_IN_SKIP 190
304317
#define PCRE2_ERROR_NO_SURROGATES_IN_UTF16 191
305318
#define PCRE2_ERROR_BAD_LITERAL_OPTIONS 192
319+
#define PCRE2_ERROR_SUPPORTED_ONLY_IN_UNICODE 193
320+
#define PCRE2_ERROR_INVALID_HYPHEN_IN_OPTIONS 194
306321

307322

308323
/* "Expected" matching error codes: no match and partial match. */
@@ -387,6 +402,7 @@ released, the numbers must not be changed. */
387402
#define PCRE2_ERROR_BADSERIALIZEDDATA (-62)
388403
#define PCRE2_ERROR_HEAPLIMIT (-63)
389404
#define PCRE2_ERROR_CONVERT_SYNTAX (-64)
405+
#define PCRE2_ERROR_INTERNAL_DUPMATCH (-65)
390406

391407

392408
/* Request types for pcre2_pattern_info() */

ext/pcre/pcre2lib/pcre2_auto_possess.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
77
88
Written by Philip Hazel
99
Original API code Copyright (c) 1997-2012 University of Cambridge
10-
New API code Copyright (c) 2016-2017 University of Cambridge
10+
New API code Copyright (c) 2016-2018 University of Cambridge
1111
1212
-----------------------------------------------------------------------------
1313
Redistribution and use in source and binary forms, with or without
@@ -505,7 +505,7 @@ which case the base cannot be possessified.
505505
utf TRUE in UTF mode
506506
cb compile data block
507507
base_list the data list of the base opcode
508-
base_end the end of the data list
508+
base_end the end of the base opcode
509509
rec_limit points to recursion depth counter
510510
511511
Returns: TRUE if the auto-possessification is possible
@@ -730,7 +730,7 @@ for(;;)
730730
if ((*xclass_flags & XCL_MAP) == 0)
731731
{
732732
/* No bits are set for characters < 256. */
733-
if (list[1] == 0) return TRUE;
733+
if (list[1] == 0) return (*xclass_flags & XCL_NOT) == 0;
734734
/* Might be an empty repeat. */
735735
continue;
736736
}
@@ -1235,6 +1235,7 @@ for (;;)
12351235
#endif
12361236

12371237
case OP_MARK:
1238+
case OP_COMMIT_ARG:
12381239
case OP_PRUNE_ARG:
12391240
case OP_SKIP_ARG:
12401241
case OP_THEN_ARG:

0 commit comments

Comments
 (0)