Skip to content

Commit fdfbcd9

Browse files
committed
Remove previous incorrect patch
1 parent 741390c commit fdfbcd9

File tree

4 files changed

+20
-23
lines changed

4 files changed

+20
-23
lines changed

ChangeLog

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,10 @@ restrictions on POSIX classes.
146146
pcre2_dfa_match() misbehaved. PCRE2_FIRSTLINE is now ignored for anchored
147147
patterns.
148148

149-
38. If PCRE2_ENDANCHORED was set and the end of the pattern was reached during
150-
a recursion, pcre2_match() misbehaved and gave the wrong match. For example,
151-
the pattern /|a(?0)/ matched against "aaaa".
152-
153-
39. Add a test for ridiculous ovector offset values to the substring extraction
149+
38. Add a test for ridiculous ovector offset values to the substring extraction
154150
functions.
155151

156-
40. Make OP_REVERSE use IMM2_SIZE for its data instead of LINK_SIZE, for
152+
39. Make OP_REVERSE use IMM2_SIZE for its data instead of LINK_SIZE, for
157153
consistency with OP_VREVERSE.
158154

159155

src/pcre2_match.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -833,18 +833,6 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
833833
case OP_ACCEPT:
834834
case OP_END:
835835

836-
/* Fail if PCRE2_ENDANCHORED is set and the end of the match is not
837-
the end of the subject. After (*ACCEPT) we fail the entire match (at this
838-
position) but backtrack if we've reached the end of the pattern. This
839-
applies whether or not we are in a recursion. */
840-
841-
if (Feptr < mb->end_subject &&
842-
((mb->moptions | mb->poptions) & PCRE2_ENDANCHORED) != 0)
843-
{
844-
if (Fop == OP_END) RRETURN(MATCH_NOMATCH);
845-
return MATCH_NOMATCH; /* (*ACCEPT) */
846-
}
847-
848836
/* Handle end of a recursion. */
849837

850838
if (Fcurrent_recurse != RECURSE_UNSET)
@@ -883,6 +871,18 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
883871
Fstart_match == mb->start_subject + mb->start_offset)))
884872
RRETURN(MATCH_NOMATCH);
885873

874+
/* Fail if PCRE2_ENDANCHORED is set and the end of the match is not
875+
the end of the subject. After (*ACCEPT) we fail the entire match (at this
876+
position) but backtrack if we've reached the end of the pattern. This
877+
applies whether or not we are in a recursion. */
878+
879+
if (Feptr < mb->end_subject &&
880+
((mb->moptions | mb->poptions) & PCRE2_ENDANCHORED) != 0)
881+
{
882+
if (Fop == OP_END) RRETURN(MATCH_NOMATCH);
883+
return MATCH_NOMATCH; /* (*ACCEPT) */
884+
}
885+
886886
/* We have a successful match of the whole pattern. Record the result and
887887
then do a direct return from the function. If there is space in the offset
888888
vector, set any pairs that follow the highest-numbered captured string but

testdata/testinput2

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6041,7 +6041,8 @@ a)"xI
60416041
\x0a
60426042
abc\x0adef
60436043

6044-
/|a(?0)/endanchored
6045-
aaaa
6044+
# This test is currently broken in the interpreter
6045+
# /|a(?0)/endanchored
6046+
# aaaa
60466047

60476048
# End of testinput2

testdata/testoutput2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17918,9 +17918,9 @@ No match
1791817918
abc\x0adef
1791917919
0: \x0a
1792017920

17921-
/|a(?0)/endanchored
17922-
aaaa
17923-
0: aaaa
17921+
# This test is currently broken in the interpreter
17922+
# /|a(?0)/endanchored
17923+
# aaaa
1792417924

1792517925
# End of testinput2
1792617926
Error -70: PCRE2_ERROR_BADDATA (unknown error number)

0 commit comments

Comments
 (0)