Skip to content

Commit 225117a

Browse files
committed
Upgrade to PCRE2 10.34
We backport the slightly modified variant from master.
1 parent 3e9dac2 commit 225117a

39 files changed

+7433
-4707
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ PHP NEWS
2626
. Fixed bug #79497 (stream_socket_client() throws an unknown error sometimes
2727
with <1s timeout). (Joe Cai)
2828

29+
PCRE:
30+
. Upgraded to PCRE2 10.34. (cmb)
31+
2932
- SPL:
3033
. Fixed bug #69264 (__debugInfo() ignored while extending SPL classes). (cmb)
3134
. Fixed bug #67369 (ArrayObject serialization drops the iterator class).

ext/pcre/pcre2lib/pcre2.h

Lines changed: 14 additions & 5 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-2018 University of Cambridge
8+
Copyright (c) 2016-2019 University of Cambridge
99
1010
-----------------------------------------------------------------------------
1111
Redistribution and use in source and binary forms, with or without
@@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
4242
/* The current PCRE version information. */
4343

4444
#define PCRE2_MAJOR 10
45-
#define PCRE2_MINOR 33
45+
#define PCRE2_MINOR 34
4646
#define PCRE2_PRERELEASE
47-
#define PCRE2_DATE 2019-04-16
47+
#define PCRE2_DATE 2019-11-21
4848

4949
/* When an application links to a PCRE DLL in Windows, the symbols that are
5050
imported have to be identified as such. When building PCRE2, the appropriate
@@ -142,6 +142,7 @@ D is inspected during pcre2_dfa_match() execution
142142
#define PCRE2_USE_OFFSET_LIMIT 0x00800000u /* J M D */
143143
#define PCRE2_EXTENDED_MORE 0x01000000u /* C */
144144
#define PCRE2_LITERAL 0x02000000u /* C */
145+
#define PCRE2_MATCH_INVALID_UTF 0x04000000u /* J M D */
145146

146147
/* An additional compile options word is available in the compile context. */
147148

@@ -305,6 +306,8 @@ pcre2_pattern_convert(). */
305306
#define PCRE2_ERROR_INVALID_HYPHEN_IN_OPTIONS 194
306307
#define PCRE2_ERROR_ALPHA_ASSERTION_UNKNOWN 195
307308
#define PCRE2_ERROR_SCRIPT_RUN_NOT_AVAILABLE 196
309+
#define PCRE2_ERROR_TOO_MANY_CAPTURES 197
310+
#define PCRE2_ERROR_CONDITION_ATOMIC_ASSERTION_EXPECTED 198
308311

309312

310313
/* "Expected" matching error codes: no match and partial match. */
@@ -390,6 +393,7 @@ released, the numbers must not be changed. */
390393
#define PCRE2_ERROR_HEAPLIMIT (-63)
391394
#define PCRE2_ERROR_CONVERT_SYNTAX (-64)
392395
#define PCRE2_ERROR_INTERNAL_DUPMATCH (-65)
396+
#define PCRE2_ERROR_DFA_UINVALID_UTF (-66)
393397

394398

395399
/* Request types for pcre2_pattern_info() */
@@ -580,7 +584,7 @@ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
580584
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
581585
pcre2_set_bsr(pcre2_compile_context *, uint32_t); \
582586
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
583-
pcre2_set_character_tables(pcre2_compile_context *, const unsigned char *); \
587+
pcre2_set_character_tables(pcre2_compile_context *, const uint8_t *); \
584588
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
585589
pcre2_set_compile_extra_options(pcre2_compile_context *, uint32_t); \
586590
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
@@ -675,6 +679,8 @@ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
675679
pcre2_match_data_free(pcre2_match_data *); \
676680
PCRE2_EXP_DECL PCRE2_SPTR PCRE2_CALL_CONVENTION \
677681
pcre2_get_mark(pcre2_match_data *); \
682+
PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
683+
pcre2_get_match_data_size(pcre2_match_data *); \
678684
PCRE2_EXP_DECL uint32_t PCRE2_CALL_CONVENTION \
679685
pcre2_get_ovector_count(pcre2_match_data *); \
680686
PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
@@ -773,7 +779,8 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
773779
pcre2_get_error_message(int, PCRE2_UCHAR *, PCRE2_SIZE); \
774780
PCRE2_EXP_DECL const uint8_t PCRE2_CALL_CONVENTION \
775781
*pcre2_maketables(pcre2_general_context *); \
776-
782+
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
783+
pcre2_maketables_free(pcre2_general_context *, const uint8_t *);
777784

778785
/* Define macros that generate width-specific names from generic versions. The
779786
three-level macro scheme is necessary to get the macros expanded when we want
@@ -838,6 +845,7 @@ pcre2_compile are called by application code. */
838845
#define pcre2_general_context_free PCRE2_SUFFIX(pcre2_general_context_free_)
839846
#define pcre2_get_error_message PCRE2_SUFFIX(pcre2_get_error_message_)
840847
#define pcre2_get_mark PCRE2_SUFFIX(pcre2_get_mark_)
848+
#define pcre2_get_match_data_size PCRE2_SUFFIX(pcre2_get_match_data_size_)
841849
#define pcre2_get_ovector_pointer PCRE2_SUFFIX(pcre2_get_ovector_pointer_)
842850
#define pcre2_get_ovector_count PCRE2_SUFFIX(pcre2_get_ovector_count_)
843851
#define pcre2_get_startchar PCRE2_SUFFIX(pcre2_get_startchar_)
@@ -848,6 +856,7 @@ pcre2_compile are called by application code. */
848856
#define pcre2_jit_stack_create PCRE2_SUFFIX(pcre2_jit_stack_create_)
849857
#define pcre2_jit_stack_free PCRE2_SUFFIX(pcre2_jit_stack_free_)
850858
#define pcre2_maketables PCRE2_SUFFIX(pcre2_maketables_)
859+
#define pcre2_maketables_free PCRE2_SUFFIX(pcre2_maketables_free_)
851860
#define pcre2_match PCRE2_SUFFIX(pcre2_match_)
852861
#define pcre2_match_context_copy PCRE2_SUFFIX(pcre2_match_context_copy_)
853862
#define pcre2_match_context_create PCRE2_SUFFIX(pcre2_match_context_create_)

ext/pcre/pcre2lib/pcre2_auto_possess.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,13 @@ for(;;)
624624
case OP_ASSERTBACK_NOT:
625625
case OP_ONCE:
626626
return !entered_a_group;
627+
628+
/* Non-atomic assertions - don't possessify last iterator. This needs
629+
more thought. */
630+
631+
case OP_ASSERT_NA:
632+
case OP_ASSERTBACK_NA:
633+
return FALSE;
627634
}
628635

629636
/* Skip over the bracket and inspect what comes next. */

0 commit comments

Comments
 (0)