Fix bad memory calculation when the first branch of a lookbehind is of zero
length.
This commit is contained in:
parent
e036cda7ea
commit
24ab24fde0
|
@ -29,6 +29,9 @@ some minor bugs and Perl incompatibilities were fixed, including:
|
||||||
existing subpattern.
|
existing subpattern.
|
||||||
(e) A conditional recursion test such as (?(R)...) misbehaved if there was a
|
(e) A conditional recursion test such as (?(R)...) misbehaved if there was a
|
||||||
group whose name began with "R".
|
group whose name began with "R".
|
||||||
|
(f) The amount of memory needed for a compiled pattern was miscalculated if a
|
||||||
|
lookbehind contained more than one toplevel branch and the first branch
|
||||||
|
was of length zero.
|
||||||
|
|
||||||
One effect of the refactoring is that some error numbers and messages have
|
One effect of the refactoring is that some error numbers and messages have
|
||||||
changed, and the pattern offset given for compiling errors is not always the
|
changed, and the pattern offset given for compiling errors is not always the
|
||||||
|
|
|
@ -7584,11 +7584,12 @@ for (;;)
|
||||||
PUT(code, 1, (int)(code - last_branch));
|
PUT(code, 1, (int)(code - last_branch));
|
||||||
bc.current_branch = last_branch = code;
|
bc.current_branch = last_branch = code;
|
||||||
code += 1 + LINK_SIZE;
|
code += 1 + LINK_SIZE;
|
||||||
lookbehindlength = META_DATA(*pptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Advance past the vertical bar */
|
/* Set the lookbehind length (if not in a lookbehind the value will be zero)
|
||||||
|
and then advance past the vertical bar. */
|
||||||
|
|
||||||
|
lookbehindlength = META_DATA(*pptr);
|
||||||
pptr++;
|
pptr++;
|
||||||
}
|
}
|
||||||
/* Control never reaches here */
|
/* Control never reaches here */
|
||||||
|
|
|
@ -4896,4 +4896,8 @@ a)"xI
|
||||||
|
|
||||||
/()(?<=(?0))/
|
/()(?<=(?0))/
|
||||||
|
|
||||||
|
/(?<!|!(?<!))/
|
||||||
|
|
||||||
|
/(?<!|!|!||||||(?<!)||(?<!)!|!||(?<!)!|!(?<!)!|!|!|!||||!!|<!)!|!||||!|/
|
||||||
|
|
||||||
# End of testinput2
|
# End of testinput2
|
||||||
|
|
|
@ -15341,6 +15341,10 @@ Subject length lower bound = 0
|
||||||
/()(?<=(?0))/
|
/()(?<=(?0))/
|
||||||
Failed: error 125 at offset 2: lookbehind assertion is not fixed length
|
Failed: error 125 at offset 2: lookbehind assertion is not fixed length
|
||||||
|
|
||||||
|
/(?<!|!(?<!))/
|
||||||
|
|
||||||
|
/(?<!|!|!||||||(?<!)||(?<!)!|!||(?<!)!|!(?<!)!|!|!|!||||!!|<!)!|!||||!|/
|
||||||
|
|
||||||
# End of testinput2
|
# End of testinput2
|
||||||
Error -63: PCRE2_ERROR_BADDATA (unknown error number)
|
Error -63: PCRE2_ERROR_BADDATA (unknown error number)
|
||||||
Error -62: bad serialized data
|
Error -62: bad serialized data
|
||||||
|
|
Loading…
Reference in New Issue