Fix ACCEPT issue with ENDANCHORED.

This commit is contained in:
Philip.Hazel 2017-04-11 14:53:26 +00:00
parent 14989bd454
commit 3b8672bf49
4 changed files with 53 additions and 2 deletions

View File

@ -0,0 +1,40 @@
<html>
<head>
<title>pcre2_set_heap_limit specification</title>
</head>
<body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
<h1>pcre2_set_heap_limit man page</h1>
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>
<p>
This page is part of the PCRE2 HTML documentation. It was generated
automatically from the original man page. If there is any nonsense in it,
please consult the man page, in case the conversion went wrong.
<br>
<br><b>
SYNOPSIS
</b><br>
<P>
<b>#include &#60;pcre2.h&#62;</b>
</P>
<P>
<b>int pcre2_set_heap_limit(pcre2_match_context *<i>mcontext</i>,</b>
<b> uint32_t <i>value</i>);</b>
</P>
<br><b>
DESCRIPTION
</b><br>
<P>
This function sets the backtracking heap limit field in a match context. The
result is always zero.
</P>
<P>
There is a complete description of the PCRE2 native API in the
<a href="pcre2api.html"><b>pcre2api</b></a>
page and a description of the POSIX API in the
<a href="pcre2posix.html"><b>pcre2posix</b></a>
page.
<p>
Return to the <a href="index.html">PCRE2 index page</a>.
</p>

View File

@ -802,11 +802,15 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
RRETURN(MATCH_NOMATCH); RRETURN(MATCH_NOMATCH);
/* Also fail if PCRE2_ENDANCHORED is set and the end of the match is not /* Also fail if PCRE2_ENDANCHORED is set and the end of the match is not
the end of the subject. */ the end of the subject. After (*ACCEPT) we fail the entire match (at this
position) but backtrack on reaching the end of the pattern. */
if (Feptr < mb->end_subject && if (Feptr < mb->end_subject &&
((mb->moptions | mb->poptions) & PCRE2_ENDANCHORED) != 0) ((mb->moptions | mb->poptions) & PCRE2_ENDANCHORED) != 0)
RRETURN(MATCH_NOMATCH); {
if (Fop == OP_END) RRETURN(MATCH_NOMATCH);
return MATCH_NOMATCH;
}
/* We have a successful match of the whole pattern. Record the result and /* We have a successful match of the whole pattern. Record the result and
then do a direct return from the function. If there is space in the offset then do a direct return from the function. If there is space in the offset

3
testdata/testinput2 vendored
View File

@ -5038,6 +5038,9 @@ a)"xI
\= Expect no match \= Expect no match
xyzabcdef xyzabcdef
/a(*ACCEPT)x|aa/endanchored
aaa
#subject -no_jit #subject -no_jit
# Check auto-anchoring when there is a group that is never obeyed at # Check auto-anchoring when there is a group that is never obeyed at

View File

@ -15574,6 +15574,10 @@ No match
xyzabcdef xyzabcdef
No match No match
/a(*ACCEPT)x|aa/endanchored
aaa
0: a
#subject -no_jit #subject -no_jit
# Check auto-anchoring when there is a group that is never obeyed at # Check auto-anchoring when there is a group that is never obeyed at