Diagnose an overall recursion (?0) inside a lookbehind as an error.
This commit is contained in:
parent
d117300a1d
commit
2821076981
|
@ -96,6 +96,9 @@ only when PCRE2_NO_START_OPTIMIZE was *not* set:
|
|||
16. The "offset" modifier in pcre2test was not being ignored (as documented)
|
||||
when the POSIX API was in use.
|
||||
|
||||
17. An overall recursion such as (?0) inside a lookbehind assertion was not
|
||||
being diagnosed as an error.
|
||||
|
||||
|
||||
Version 10.22 29-July-2016
|
||||
--------------------------
|
||||
|
|
|
@ -8497,12 +8497,13 @@ for (;; pptr++)
|
|||
*errcodeptr = ERR15; /* Non-existent subpattern */
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (group == 0) goto ISNOTFIXED; /* Local recursion */
|
||||
for (gptr = cb->parsed_pattern; *gptr != META_END; gptr++)
|
||||
{
|
||||
if (META_CODE(*gptr) == META_BIGVALUE) gptr++;
|
||||
else if (*gptr == (META_CAPTURE | group)) break;
|
||||
}
|
||||
|
||||
gptrend = parsed_skip(gptr, PSKIP_KET);
|
||||
if (pptr > gptr && pptr < gptrend) goto ISNOTFIXED; /* Local recursion */
|
||||
for (r = recurses; r != NULL; r = r->prev) if (r->groupptr == gptr) break;
|
||||
|
|
|
@ -4894,4 +4894,6 @@ a)"xI
|
|||
|
||||
/(?=.*[A-Z])/I
|
||||
|
||||
/()(?<=(?0))/
|
||||
|
||||
# End of testinput2
|
||||
|
|
|
@ -15338,6 +15338,9 @@ Capturing subpattern count = 0
|
|||
May match empty string
|
||||
Subject length lower bound = 0
|
||||
|
||||
/()(?<=(?0))/
|
||||
Failed: error 125 at offset 2: lookbehind assertion is not fixed length
|
||||
|
||||
# End of testinput2
|
||||
Error -63: PCRE2_ERROR_BADDATA (unknown error number)
|
||||
Error -62: bad serialized data
|
||||
|
|
Loading…
Reference in New Issue