Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regrepeat: Use new utf8_to_uv; not utf8_to_uvchr_buf #22827

Open
wants to merge 1 commit into
base: blead
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 15 additions & 26 deletions regexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -10272,6 +10272,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,

switch (with_t_UTF8ness(OP(p), utf8_target)) {
SV * anyofh_list;
UV cp; /* temporary */

case REG_ANY_t8:
while (scan < this_eol && hardcount < max && *scan != '\n') {
Expand Down Expand Up @@ -10554,10 +10555,8 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
while ( hardcount < max
&& scan < this_eol
&& NATIVE_UTF8_TO_I8(*scan) >= ANYOF_FLAGS(p)
&& _invlist_contains_cp(anyofh_list,
utf8_to_uvchr_buf((U8 *) scan,
(U8 *) this_eol,
NULL)))
&& utf8_to_uv((U8 *) scan, (U8 *) this_eol, &cp, NULL)
&& _invlist_contains_cp(anyofh_list, cp))
{
scan += UTF8SKIP(scan);
hardcount++;
Expand All @@ -10570,10 +10569,8 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
while ( hardcount < max
&& scan < this_eol
&& (U8) *scan == ANYOF_FLAGS(p)
&& _invlist_contains_cp(anyofh_list,
utf8_to_uvchr_buf((U8 *) scan,
(U8 *) this_eol,
NULL)))
&& utf8_to_uv((U8 *) scan, (U8 *) this_eol, &cp, NULL)
&& _invlist_contains_cp(anyofh_list, cp))
{
scan += UTF8SKIP(scan);
hardcount++;
Expand All @@ -10600,10 +10597,8 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
LOWEST_ANYOF_HRx_BYTE(ANYOF_FLAGS(p)),
HIGHEST_ANYOF_HRx_BYTE(ANYOF_FLAGS(p)))
&& NATIVE_UTF8_TO_I8(*scan) >= ANYOF_FLAGS(p)
&& _invlist_contains_cp(anyofh_list,
utf8_to_uvchr_buf((U8 *) scan,
(U8 *) this_eol,
NULL)))
&& utf8_to_uv((U8 *) scan, (U8 *) this_eol, &cp, NULL)
&& _invlist_contains_cp(anyofh_list, cp))
{
scan += UTF8SKIP(scan);
hardcount++;
Expand All @@ -10615,10 +10610,8 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
while ( hardcount < max
&& scan + FLAGS(p) < this_eol
&& memEQ(scan, ((struct regnode_anyofhs *) p)->string, FLAGS(p))
&& _invlist_contains_cp(anyofh_list,
utf8_to_uvchr_buf((U8 *) scan,
(U8 *) this_eol,
NULL)))
&& utf8_to_uv((U8 *) scan, (U8 *) this_eol, &cp, NULL)
&& _invlist_contains_cp(anyofh_list, cp))
{
scan += UTF8SKIP(scan);
hardcount++;
Expand All @@ -10629,10 +10622,8 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
while ( hardcount < max
&& scan < this_eol
&& NATIVE_UTF8_TO_I8(*scan) >= ANYOF_FLAGS(p)
&& withinCOUNT(utf8_to_uvchr_buf((U8 *) scan,
(U8 *) this_eol,
NULL),
ANYOFRbase(p), ANYOFRdelta(p)))
&& utf8_to_uv((U8 *) scan, (U8 *) this_eol, &cp, NULL)
&& withinCOUNT(cp, ANYOFRbase(p), ANYOFRdelta(p)))
{
scan += UTF8SKIP(scan);
hardcount++;
Expand All @@ -10653,10 +10644,8 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
while ( hardcount < max
&& scan < this_eol
&& (U8) *scan == ANYOF_FLAGS(p)
&& withinCOUNT(utf8_to_uvchr_buf((U8 *) scan,
(U8 *) this_eol,
NULL),
ANYOFRbase(p), ANYOFRdelta(p)))
&& utf8_to_uv((U8 *) scan, (U8 *) this_eol, &cp, NULL)
&& withinCOUNT(cp, ANYOFRbase(p), ANYOFRdelta(p)))
{
scan += UTF8SKIP(scan);
hardcount++;
Expand Down Expand Up @@ -10767,9 +10756,9 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
switch (classnum) {
default:
while ( hardcount < max && scan < this_eol
&& utf8_to_uv((U8 *) scan, (U8 *) this_eol, &cp, NULL)
&& to_complement
^ cBOOL(_invlist_contains_cp(PL_XPosix_ptrs[classnum],
utf8_to_uvchr_buf((U8 *) scan, (U8 *) this_eol, NULL))))
^ cBOOL(_invlist_contains_cp(PL_XPosix_ptrs[classnum], cp)))
{
scan += UTF8SKIP(scan);
hardcount++;
Expand Down
Loading