From: Hugo van der Sanden Date: Mon, 21 Oct 2002 03:21:54 +0000 (+0100) Subject: Re: [perl #18019] regex overoptimization X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c152dc430a400da208b684f936f242f4a89972f4;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #18019] regex overoptimization Message-Id: <200210210221.g9L2LsU32598@crypt.compulink.co.uk> p4raw-id: //depot/perl@18041 --- diff --git a/regcomp.c b/regcomp.c index cc283a6..8afb8ab 100644 --- 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... */ diff --git a/t/op/re_tests b/t/op/re_tests index dcd6fdc..d7e24f3 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -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]