From: Hugo van der Sanden Date: Mon, 21 May 2001 16:32:02 +0000 (+0100) Subject: Re: [ID 20000716.007] \G in a m//g expression causes problems X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=997999616a41239c1d6c9779baa38c6a3a23f85e;p=p5sagit%2Fp5-mst-13.2.git Re: [ID 20000716.007] \G in a m//g expression causes problems Message-Id: <200105211532.QAA03999@crypt.compulink.co.uk> p4raw-id: //depot/perl@10187 --- diff --git a/regcomp.c b/regcomp.c index 1fdc44a..fbda209 100644 --- a/regcomp.c +++ b/regcomp.c @@ -1059,7 +1059,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, I32 *deltap, reg if (!scan) /* It was not CURLYX, but CURLY. */ scan = next; if (ckWARN(WARN_REGEXP) && (minnext + deltanext == 0) - && !(data->flags & (SF_HAS_PAR|SF_IN_PAR)) + && data && !(data->flags & (SF_HAS_PAR|SF_IN_PAR)) && maxcount <= REG_INFTY/3) /* Complement check for big count */ { vWARN(RExC_parse, diff --git a/t/op/misc.t b/t/op/misc.t index 885fad4..c791f15 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -661,6 +661,11 @@ new_pmop "abcdef"; reset; close STDERR; die; EXPECT ######## +-w +"x" =~ /(\G?x)?/; # core dump in 20000716.007 +EXPECT +Quantifier unexpected on zero-length expression in regex; marked by <-- HERE in m/(\G?x)? <-- HERE / at - line 2. +######## # Bug 20010515.004 my @h = 1 .. 10; bad(@h);