From 49a7eada2d459af97babf86ce7e40059993123c4 Mon Sep 17 00:00:00 2001
From: "Philip.Hazel"
+If a pattern that starts with (*NO_JIT) is successfully compiled, an attempt by +the application to apply the JIT optimization by calling +pcre2_jit_compile() is ignored. +
+@@ -1715,8 +1723,8 @@ items: the \R escape sequence an escape such as \d or \pL that matches a single character a character class - a back reference (see next section) - a parenthesized subpattern (including assertions) + a back reference + a parenthesized subpattern (including most assertions) a subroutine call to a subpattern (recursive or otherwise) The general repetition quantifier specifies a minimum and maximum number of @@ -2126,10 +2134,11 @@ capturing is carried out only for positive assertions. (Perl sometimes, but not always, does do capturing in negative assertions.)
-For compatibility with Perl, assertion subpatterns may be repeated; though
+For compatibility with Perl, most assertion subpatterns may be repeated; though
it makes no sense to assert the same thing several times, the side effect of
-capturing parentheses may occasionally be useful. In practice, there only three
-cases:
+capturing parentheses may occasionally be useful. However, an assertion that
+forms the condition for a conditional subpattern may not be quantified. In
+practice, for other assertions, there only three cases:
(1) If the quantifier is {0}, the assertion is never obeyed during matching.
@@ -3249,7 +3258,7 @@ Cambridge, England.
-Last updated: 26 January 2015
+Last updated: 28 January 2015
Copyright © 1997-2015 University of Cambridge.
diff --git a/doc/html/pcre2syntax.html b/doc/html/pcre2syntax.html
index 373b5aa..1b7237f 100644
--- a/doc/html/pcre2syntax.html
+++ b/doc/html/pcre2syntax.html
@@ -417,6 +417,7 @@ appear.
(*NOTEMPTY_ATSTART) set PCRE2_NOTEMPTY_ATSTART when matching
(*NO_AUTO_POSSESS) no auto-possessification (PCRE2_NO_AUTO_POSSESS)
(*NO_DOTSTAR_ANCHOR) no .* anchoring (PCRE2_NO_DOTSTAR_ANCHOR)
+ (*NO_JIT) disable JIT optimization
(*NO_START_OPT) no start-match optimization (PCRE2_NO_START_OPTIMIZE)
(*UTF) set appropriate UTF mode for the library in use
(*UCP) set PCRE2_UCP (use Unicode properties for \d etc)
@@ -554,7 +555,7 @@ Cambridge, England.
-Last updated: 02 January 2015
+Last updated: 26 January 2015
Copyright © 1997-2015 University of Cambridge.
diff --git a/doc/pcre2pattern.3 b/doc/pcre2pattern.3
index 5f9ba78..e0d9b49 100644
--- a/doc/pcre2pattern.3
+++ b/doc/pcre2pattern.3
@@ -133,9 +133,9 @@ documentation.
.SS "Disabling JIT compilation"
.rs
.sp
-If a pattern that starts with (*NO_JIT) is successfully compiled, an attempt by
-the application to apply the JIT optimization by calling
-\fBpcre2_jit_compile()\fP is ignored.
+If a pattern that starts with (*NO_JIT) is successfully compiled, an attempt by
+the application to apply the JIT optimization by calling
+\fBpcre2_jit_compile()\fP is ignored.
.
.
.SS "Setting match and recursion limits"
@@ -2154,7 +2154,7 @@ always, does do capturing in negative assertions.)
.P
For compatibility with Perl, most assertion subpatterns may be repeated; though
it makes no sense to assert the same thing several times, the side effect of
-capturing parentheses may occasionally be useful. However, an assertion that
+capturing parentheses may occasionally be useful. However, an assertion that
forms the condition for a conditional subpattern may not be quantified. In
practice, for other assertions, there only three cases:
.sp
diff --git a/doc/pcre2syntax.3 b/doc/pcre2syntax.3
index 2802c89..f7e231c 100644
--- a/doc/pcre2syntax.3
+++ b/doc/pcre2syntax.3
@@ -390,7 +390,7 @@ appear.
(*NOTEMPTY_ATSTART) set PCRE2_NOTEMPTY_ATSTART when matching
(*NO_AUTO_POSSESS) no auto-possessification (PCRE2_NO_AUTO_POSSESS)
(*NO_DOTSTAR_ANCHOR) no .* anchoring (PCRE2_NO_DOTSTAR_ANCHOR)
- (*NO_JIT) disable JIT optimization
+ (*NO_JIT) disable JIT optimization
(*NO_START_OPT) no start-match optimization (PCRE2_NO_START_OPTIMIZE)
(*UTF) set appropriate UTF mode for the library in use
(*UCP) set PCRE2_UCP (use Unicode properties for \ed etc)
diff --git a/src/pcre2.h.generic b/src/pcre2.h.generic
index 05ad575..0620ed9 100644
--- a/src/pcre2.h.generic
+++ b/src/pcre2.h.generic
@@ -44,7 +44,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define PCRE2_MAJOR 10
#define PCRE2_MINOR 10
#define PCRE2_PRERELEASE -RC1
-#define PCRE2_DATE 2014-01-13
+#define PCRE2_DATE 2015-02-20
/* When an application links to a PCRE DLL in Windows, the symbols that are
imported have to be identified as such. When building PCRE2, the appropriate
@@ -198,11 +198,13 @@ greater than zero. */
#define PCRE2_ERROR_UTF32_ERR1 (-27)
#define PCRE2_ERROR_UTF32_ERR2 (-28)
-/* Error codes for pcre2[_dfa]_match(), substring extraction functions, and
-context functions. */
+/* Error codes for pcre2[_dfa]_match(), substring extraction functions, context
+functions, and serializing functions. They are in numerical order. Originally
+they were in alphabetical order too, but now that PCRE2 is released, the
+numbers must not be changed. */
#define PCRE2_ERROR_BADDATA (-29)
-#define PCRE2_ERROR_BADLENGTH (-30)
+#define PCRE2_ERROR_MIXEDTABLES (-30) /* Name was changed */
#define PCRE2_ERROR_BADMAGIC (-31)
#define PCRE2_ERROR_BADMODE (-32)
#define PCRE2_ERROR_BADOFFSET (-33)
@@ -458,13 +460,12 @@ PCRE2_EXP_DECL int pcre2_substring_list_get(pcre2_match_data *, \
/* Functions for serializing / deserializing compiled patterns. */
#define PCRE2_SERIALIZE_FUNCTIONS \
-PCRE2_EXP_DECL int pcre2_serialize_encode(const pcre2_code **, \
- PCRE2_SIZE, uint8_t **, PCRE2_SIZE *, \
+PCRE2_EXP_DECL int32_t pcre2_serialize_encode(const pcre2_code **, \
+ int32_t, uint8_t **, PCRE2_SIZE *, \
pcre2_general_context *); \
-PCRE2_EXP_DECL int pcre2_serialize_decode(pcre2_code **, PCRE2_SIZE, \
+PCRE2_EXP_DECL int32_t pcre2_serialize_decode(pcre2_code **, int32_t, \
const uint8_t *, pcre2_general_context *); \
-PCRE2_EXP_DECL int pcre2_serialize_get_number_of_codes(const uint8_t *, \
- PCRE2_SIZE *); \
+PCRE2_EXP_DECL int32_t pcre2_serialize_get_number_of_codes(const uint8_t *); \
PCRE2_EXP_DECL void pcre2_serialize_free(uint8_t *);
diff --git a/src/pcre2_auto_possess.c b/src/pcre2_auto_possess.c
index 0e050e6..15dd770 100644
--- a/src/pcre2_auto_possess.c
+++ b/src/pcre2_auto_possess.c
@@ -1090,8 +1090,8 @@ but some compilers complain about an unreachable statement. */
*************************************************/
/* Replaces single character iterations with their possessive alternatives
-if appropriate. This function modifies the compiled opcode! Hitting a
-non-existant opcode may indicate a bug in PCRE2, but it can also be caused if a
+if appropriate. This function modifies the compiled opcode! Hitting a
+non-existant opcode may indicate a bug in PCRE2, but it can also be caused if a
bad UTF string was compiled with PCRE2_NO_UTF_CHECK.
Arguments:
@@ -1114,9 +1114,9 @@ uint32_t list[8];
for (;;)
{
c = *code;
-
- if (c > OP_TABLE_LENGTH) return -1; /* Something gone wrong */
-
+
+ if (c > OP_TABLE_LENGTH) return -1; /* Something gone wrong */
+
if (c >= OP_STAR && c <= OP_TYPEPOSUPTO)
{
c -= get_repeat_base(c) - OP_STAR;
diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c
index a55ab65..a79b2b8 100644
--- a/src/pcre2_compile.c
+++ b/src/pcre2_compile.c
@@ -5208,7 +5208,7 @@ for (;; ptr++)
/* For conditions that are assertions, check the syntax, and then exit
the switch. This will take control down to where bracketed groups
are processed. The assertion will be handled as part of the group,
- but we need to identify this case because the conditional assertion may
+ but we need to identify this case because the conditional assertion may
not be quantifier. */
if (tempptr[1] == CHAR_QUESTION_MARK &&
@@ -5216,9 +5216,9 @@ for (;; ptr++)
tempptr[2] == CHAR_EXCLAMATION_MARK ||
tempptr[2] == CHAR_LESS_THAN_SIGN))
{
- cb->iscondassert = TRUE;
+ cb->iscondassert = TRUE;
break;
- }
+ }
/* Other conditions use OP_CREF/OP_DNCREF/OP_RREF/OP_DNRREF, and all
need to skip at least 1+IMM2_SIZE bytes at the start of the group. */
@@ -5771,10 +5771,10 @@ for (;; ptr++)
/* If duplicate names are permitted, we have to allow for a named
reference to a duplicated name (this cannot be determined until the
- second pass). This needs an extra data item. Counting named back
- references and incrementing the count at the end does not work
- because it does not account for duplication of groups containing such
- references. Nor does checking for PCRE2_DUPNAMES because that need
+ second pass). This needs an extra data item. Counting named back
+ references and incrementing the count at the end does not work
+ because it does not account for duplication of groups containing such
+ references. Nor does checking for PCRE2_DUPNAMES because that need
not be set at the point of reference. */
*lengthptr += IMM2_SIZE;
@@ -6132,11 +6132,11 @@ for (;; ptr++)
}
/* All assertions used not to be repeatable, but this was changed for Perl
- compatibility. All kinds can now be repeated except for assertions that are
+ compatibility. All kinds can now be repeated except for assertions that are
conditions (Perl also forbids these to be repeated). We copy code into a
non-register variable (tempcode) in order to be able to pass its address
- because some compilers complain otherwise. At the start of a conditional
- group whose condition is an assertion, cb->iscondassert is set. We unset it
+ because some compilers complain otherwise. At the start of a conditional
+ group whose condition is an assertion, cb->iscondassert is set. We unset it
here so as to allow assertions later in the group to be quantified. */
if (bravalue >= OP_ASSERT && bravalue <= OP_ASSERTBACK_NOT &&
@@ -6145,8 +6145,8 @@ for (;; ptr++)
previous = NULL;
cb->iscondassert = FALSE;
}
- else previous = code;
-
+ else previous = code;
+
*code = bravalue;
tempcode = code;
tempreqvary = cb->req_varyopt; /* Save value before bracket */
@@ -6917,7 +6917,7 @@ for (;;)
}
/* Fill in the ket */
-
+
*code = OP_KET;
PUT(code, 1, (int)(code - start_bracket));
code += 1 + LINK_SIZE;
@@ -7725,7 +7725,7 @@ if (re == NULL)
errorcode = ERR21;
goto HAD_ERROR;
}
-
+
re->memctl = ccontext->memctl;
re->tables = tables;
re->executable_jit = NULL;
@@ -7831,7 +7831,7 @@ if (usedlength > length) errorcode = ERR23; else
/* Fill in any forward references that are required. There may be repeated
references; optimize for them, as searching a large regex takes time. The
-test of errorcode inside the loop means that nothing is done if it is already
+test of errorcode inside the loop means that nothing is done if it is already
non-zero. */
if (cb.hwm > cb.start_workspace)
@@ -7878,7 +7878,7 @@ if (errorcode == 0)
PCRE2_UCHAR *temp = (PCRE2_UCHAR *)codestart;
if (PRIV(auto_possessify)(temp, utf, &cb) != 0) errorcode = ERR80;
}
- }
+ }
/* If there were any lookbehind assertions that contained OP_RECURSE
(recursions or subroutine calls), a flag is set for them to be checked here,
diff --git a/src/pcre2_error.c b/src/pcre2_error.c
index 3cd8792..07d92de 100644
--- a/src/pcre2_error.c
+++ b/src/pcre2_error.c
@@ -159,7 +159,7 @@ static const char compile_error_texts[] =
"character code point value in \\u.... sequence is too large\0"
"digits missing in \\x{} or \\o{}\0"
"syntax error in (?(VERSION condition\0"
- /* 80 */
+ /* 80 */
"internal error: unknown opcode in auto_possessify()\0"
;
diff --git a/src/pcre2_intmodedep.h b/src/pcre2_intmodedep.h
index 7172acf..f38581f 100644
--- a/src/pcre2_intmodedep.h
+++ b/src/pcre2_intmodedep.h
@@ -585,9 +585,9 @@ typedef struct pcre2_real_match_context {
} pcre2_real_match_context;
/* The real compiled code structure. The type for the blocksize field is
-defined specially because it is required in pcre2_serialize_decode() when
-copying the size from possibly unaligned memory into a variable of the same
-type. Use a macro rather than a typedef to avoid compiler warnings when this
+defined specially because it is required in pcre2_serialize_decode() when
+copying the size from possibly unaligned memory into a variable of the same
+type. Use a macro rather than a typedef to avoid compiler warnings when this
file is included multiple times by pcre2test. */
#undef CODE_BLOCKSIZE_TYPE
@@ -695,7 +695,7 @@ typedef struct compile_block {
BOOL had_pruneorskip; /* (*PRUNE) or (*SKIP) encountered */
BOOL check_lookbehind; /* Lookbehinds need later checking */
BOOL dupnames; /* Duplicate names exist */
- BOOL iscondassert; /* Next assert is a condition */
+ BOOL iscondassert; /* Next assert is a condition */
} compile_block;
/* Structure for keeping the properties of the in-memory stack used
diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c
index 0306db6..f6d2a68 100644
--- a/src/pcre2_jit_compile.c
+++ b/src/pcre2_jit_compile.c
@@ -10325,7 +10325,7 @@ Arguments:
options JIT option bits
Returns: 0: success or (*NOJIT) was used
- <0: an error code
+ <0: an error code
*/
#define PUBLIC_JIT_COMPILE_OPTIONS \
@@ -10351,7 +10351,7 @@ if (code == NULL)
if ((options & ~PUBLIC_JIT_COMPILE_OPTIONS) != 0)
return PCRE2_ERROR_JIT_BADOPTION;
-
+
if ((re->flags & PCRE2_NOJIT) != 0) return 0;
functions = (executable_functions *)re->executable_jit;
diff --git a/src/pcre2_study.c b/src/pcre2_study.c
index 16e61d7..3f93a12 100644
--- a/src/pcre2_study.c
+++ b/src/pcre2_study.c
@@ -77,9 +77,9 @@ Arguments:
utf UTF flag
Returns: the minimum length
- -1 \C in UTF-8 mode
+ -1 \C in UTF-8 mode
or (*ACCEPT)
- or too much back reference recursion
+ or too much back reference recursion
-2 internal error (missing capturing bracket)
-3 internal error (opcode not listed)
*/