Revision: 1157
http://www.exim.org/viewvc/pcre2?view=rev&revision=1157
Author: ph10
Date: 2019-08-10 12:34:50 +0100 (Sat, 10 Aug 2019)
Log Message:
-----------
Fix allusedtext bug, rightmost consulted character incorrect in negative
lookaheads.
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/src/pcre2_match.c
code/trunk/testdata/testinput15
code/trunk/testdata/testinput2
code/trunk/testdata/testoutput15
code/trunk/testdata/testoutput2
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2019-08-07 17:21:02 UTC (rev 1156)
+++ code/trunk/ChangeLog 2019-08-10 11:34:50 UTC (rev 1157)
@@ -129,7 +129,11 @@
incorrectly recorded as 65535, leading to incorrect "no match" when start-up
optimizations were in force.
+29. The "rightmost consulted character" value was not always correct; in
+particular, if a pattern ended with a negative lookahead, characters that were
+inspected in that lookahead were not included.
+
Version 10.33 16-April-2019
---------------------------
Modified: code/trunk/src/pcre2_match.c
===================================================================
--- code/trunk/src/pcre2_match.c 2019-08-07 17:21:02 UTC (rev 1156)
+++ code/trunk/src/pcre2_match.c 2019-08-10 11:34:50 UTC (rev 1157)
@@ -5971,6 +5971,7 @@
#define LBL(val) case val: goto L_RM##val;
RETURN_SWITCH:
+if (Feptr > mb->last_used_ptr) mb->last_used_ptr = Feptr;
if (Frdepth == 0) return rrc; /* Exit from the top level */
F = (heapframe *)((char *)F - Fback_frame); /* Backtrack */
mb->cb->callout_flags |= PCRE2_CALLOUT_BACKTRACK; /* Note for callouts */
Modified: code/trunk/testdata/testinput15
===================================================================
--- code/trunk/testdata/testinput15 2019-08-07 17:21:02 UTC (rev 1156)
+++ code/trunk/testdata/testinput15 2019-08-10 11:34:50 UTC (rev 1157)
@@ -231,4 +231,8 @@
/(*LIMIT_HEAP=21)\[(a)]{60}/expand
\[a]{60}
+/b(?<!ax)(?!cx)/allusedtext
+ abc
+ abcz
+
# End of testinput15
Modified: code/trunk/testdata/testinput2
===================================================================
--- code/trunk/testdata/testinput2 2019-08-07 17:21:02 UTC (rev 1156)
+++ code/trunk/testdata/testinput2 2019-08-10 11:34:50 UTC (rev 1157)
@@ -4584,7 +4584,7 @@
/abcd/null_context
abcd\=null_context
-\= Expect error
+\= Expect error - not allowed together
abcd\=null_context,find_limits
abcd\=allusedtext,startchar
Modified: code/trunk/testdata/testoutput15
===================================================================
--- code/trunk/testdata/testoutput15 2019-08-07 17:21:02 UTC (rev 1156)
+++ code/trunk/testdata/testoutput15 2019-08-10 11:34:50 UTC (rev 1157)
@@ -525,4 +525,12 @@
\[a]{60}
Failed: error -63: heap limit exceeded
+/b(?<!ax)(?!cx)/allusedtext
+ abc
+ 0: abc
+ < >
+ abcz
+ 0: abcz
+ < >>
+
# End of testinput15
Modified: code/trunk/testdata/testoutput2
===================================================================
--- code/trunk/testdata/testoutput2 2019-08-07 17:21:02 UTC (rev 1156)
+++ code/trunk/testdata/testoutput2 2019-08-10 11:34:50 UTC (rev 1157)
@@ -14803,7 +14803,7 @@
/abcd/null_context
abcd\=null_context
0: abcd
-\= Expect error
+\= Expect error - not allowed together
abcd\=null_context,find_limits
** Not allowed together: find_limits null_context
abcd\=allusedtext,startchar