Re: [perl #18019] regex overoptimization
Hugo van der Sanden [Mon, 21 Oct 2002 03:21:54 +0000 (04:21 +0100)]
Message-Id: <200210210221.g9L2LsU32598@crypt.compulink.co.uk>

p4raw-id: //depot/perl@18041

regcomp.c
t/op/re_tests

index cc283a6..8afb8ab 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -1306,8 +1306,8 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, I32 *deltap, reg
                        } else {
                            /* start offset must point into the last copy */
                            data->last_start_min += minnext * (mincount - 1);
-                           data->last_start_max += is_inf ? 0 : (maxcount - 1)
-                               * (minnext + data->pos_delta);
+                           data->last_start_max += is_inf ? I32_MAX
+                               : (maxcount - 1) * (minnext + data->pos_delta);
                        }
                    }
                    /* It is counted once already... */
index dcd6fdc..d7e24f3 100644 (file)
@@ -923,3 +923,4 @@ ab(?i)cd    abCd    y       -       -
 2(]*)?$\1      2       y       $&      2
 (??{}) x       y       -       -
 a(b)?? abc     y       <$1>    <>      # undef [perl #16773]
+(\d{1,3}\.){3,}        128.134.142.8   y       <$1>    <142.>  # [perl #18019]