From: Michael Cartmell Date: Wed, 2 Jul 2008 05:17:58 +0000 (-0700) Subject: [perl #56526] m/a{1,0}/ compiles but doesn't match a literal string X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8fa23287293bbec887dca6d7e006e50e1a445bb2;p=p5sagit%2Fp5-mst-13.2.git [perl #56526] m/a{1,0}/ compiles but doesn't match a literal string From: Michael Cartmell (via RT) Message-ID: p4raw-id: //depot/perl@34697 --- diff --git a/regcomp.c b/regcomp.c index 3934cec..7d1c474 100644 --- a/regcomp.c +++ b/regcomp.c @@ -6452,7 +6452,7 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth) *flagp = WORST; if (max > 0) *flagp |= HASWIDTH; - if (max && max < min) + if (max < min) vFAIL("Can't do {n,m} with n > m"); if (!SIZE_ONLY) { ARG1_SET(ret, (U16)min); diff --git a/t/op/re_tests b/t/op/re_tests index 2b74175..0992b15 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -618,6 +618,7 @@ $(?<=^(a)) a y $1 a ((?>[^()]+)|\([^()]*\))+ ((abc(ade)ufh()()x y $& abc(ade)ufh()()x (?<=x+)y - c - Variable length lookbehind not implemented a{37,17} - c - Can't do {n,m} with n > m +a{37,0} - c - Can't do {n,m} with n > m \Z a\nb\n y $-[0] 3 \z a\nb\n y $-[0] 4 $ a\nb\n y $-[0] 3