From 8fa23287293bbec887dca6d7e006e50e1a445bb2 Mon Sep 17 00:00:00 2001 From: Michael Cartmell Date: Tue, 1 Jul 2008 22:17:58 -0700 Subject: [PATCH] [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 --- regcomp.c | 2 +- t/op/re_tests | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 -- 2.7.4