Skip to content

Commit 9bc2524

Browse files
committed
regexec.c: regrepeat: Avoid UTF8SKIPs
This value is returnable from the called functions. Use it instead of re-deriving it
1 parent 90e9adb commit 9bc2524

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

regexec.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10461,6 +10461,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
1046110461

1046210462
switch (with_t_UTF8ness(OP(p), utf8_target)) {
1046310463
SV * anyofh_list;
10464+
Size_t advance;
1046410465

1046510466
case REG_ANY_t8:
1046610467
while (scan < this_eol && hardcount < max && *scan != '\n') {
@@ -10746,9 +10747,9 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
1074610747
&& _invlist_contains_cp(anyofh_list,
1074710748
utf8_to_uv_or_die((U8 *) scan,
1074810749
(U8 *) this_eol,
10749-
NULL)))
10750+
&advance)))
1075010751
{
10751-
scan += UTF8SKIP(scan);
10752+
scan += advance;
1075210753
hardcount++;
1075310754
}
1075410755
break;
@@ -10762,9 +10763,9 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
1076210763
&& _invlist_contains_cp(anyofh_list,
1076310764
utf8_to_uv_or_die((U8 *) scan,
1076410765
(U8 *) this_eol,
10765-
NULL)))
10766+
&advance)))
1076610767
{
10767-
scan += UTF8SKIP(scan);
10768+
scan += advance;
1076810769
hardcount++;
1076910770
}
1077010771
break;
@@ -10792,9 +10793,9 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
1079210793
&& _invlist_contains_cp(anyofh_list,
1079310794
utf8_to_uv_or_die((U8 *) scan,
1079410795
(U8 *) this_eol,
10795-
NULL)))
10796+
&advance)))
1079610797
{
10797-
scan += UTF8SKIP(scan);
10798+
scan += advance;
1079810799
hardcount++;
1079910800
}
1080010801
break;
@@ -10807,9 +10808,9 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
1080710808
&& _invlist_contains_cp(anyofh_list,
1080810809
utf8_to_uv_or_die((U8 *) scan,
1080910810
(U8 *) this_eol,
10810-
NULL)))
10811+
&advance)))
1081110812
{
10812-
scan += UTF8SKIP(scan);
10813+
scan += advance;
1081310814
hardcount++;
1081410815
}
1081510816
break;
@@ -10820,10 +10821,10 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
1082010821
&& NATIVE_UTF8_TO_I8(*scan) >= ANYOF_FLAGS(p)
1082110822
&& withinCOUNT(utf8_to_uv_or_die((U8 *) scan,
1082210823
(U8 *) this_eol,
10823-
NULL),
10824+
&advance),
1082410825
ANYOFRbase(p), ANYOFRdelta(p)))
1082510826
{
10826-
scan += UTF8SKIP(scan);
10827+
scan += advance;
1082710828
hardcount++;
1082810829
}
1082910830
break;
@@ -10844,10 +10845,10 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
1084410845
&& (U8) *scan == ANYOF_FLAGS(p)
1084510846
&& withinCOUNT(utf8_to_uv_or_die((U8 *) scan,
1084610847
(U8 *) this_eol,
10847-
NULL),
10848+
&advance),
1084810849
ANYOFRbase(p), ANYOFRdelta(p)))
1084910850
{
10850-
scan += UTF8SKIP(scan);
10851+
scan += advance;
1085110852
hardcount++;
1085210853
}
1085310854
break;

0 commit comments

Comments
 (0)