@@ -10912,6 +10912,20 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
10912
10912
10913
10913
do_curly:
10914
10914
if ((flags&SIMPLE)) {
10915
+ if (min == 0 && max == REG_INFTY) {
10916
+ reginsert(pRExC_state, STAR, ret, depth+1);
10917
+ ret->flags = 0;
10918
+ MARK_NAUGHTY(4);
10919
+ RExC_seen |= REG_UNBOUNDED_QUANTIFIER_SEEN;
10920
+ goto nest_check;
10921
+ }
10922
+ if (min == 1 && max == REG_INFTY) {
10923
+ reginsert(pRExC_state, PLUS, ret, depth+1);
10924
+ ret->flags = 0;
10925
+ MARK_NAUGHTY(3);
10926
+ RExC_seen |= REG_UNBOUNDED_QUANTIFIER_SEEN;
10927
+ goto nest_check;
10928
+ }
10915
10929
MARK_NAUGHTY_EXP(2, 2);
10916
10930
reginsert(pRExC_state, CURLY, ret, depth+1);
10917
10931
Set_Node_Offset(ret, parse_start+1); /* MJD */
@@ -10985,22 +10999,10 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
10985
10999
10986
11000
*flagp = (op != '+') ? (WORST|SPSTART|HASWIDTH) : (WORST|HASWIDTH);
10987
11001
10988
- if (op == '*' && (flags&SIMPLE)) {
10989
- reginsert(pRExC_state, STAR, ret, depth+1);
10990
- ret->flags = 0;
10991
- MARK_NAUGHTY(4);
10992
- RExC_seen |= REG_UNBOUNDED_QUANTIFIER_SEEN;
10993
- }
10994
- else if (op == '*') {
11002
+ if (op == '*') {
10995
11003
min = 0;
10996
11004
goto do_curly;
10997
11005
}
10998
- else if (op == '+' && (flags&SIMPLE)) {
10999
- reginsert(pRExC_state, PLUS, ret, depth+1);
11000
- ret->flags = 0;
11001
- MARK_NAUGHTY(3);
11002
- RExC_seen |= REG_UNBOUNDED_QUANTIFIER_SEEN;
11003
- }
11004
11006
else if (op == '+') {
11005
11007
min = 1;
11006
11008
goto do_curly;
0 commit comments