From: Yves Orton Date: Thu, 6 Nov 2008 10:44:13 +0000 (+0000) Subject: Resolve perl #60344: Regex lookbehind failure after an (if)then|else in perl 5.10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aff3edb5cf5195431c87166ebfe06c4721c5c783;p=p5sagit%2Fp5-mst-13.2.git Resolve perl #60344: Regex lookbehind failure after an (if)then|else in perl 5.10 During the de-recursivization it looks like Dave M forgot to reset the 'logical' flag after using it, which in turn causes UNLESSM/IFTHEN when used after a LOGICAL operator to be incorrectly intrepreted. This change resets the logical flag after each time it is stored in ST.logical. p4raw-id: //depot/perl@34746 --- diff --git a/regexec.c b/regexec.c index 326d92a..9bd5f0e 100644 --- a/regexec.c +++ b/regexec.c @@ -4983,6 +4983,7 @@ NULL do_ifmatch: ST.me = scan; ST.logical = logical; + logical = 0; /* execute body of (?...A) */ PUSH_YES_STATE_GOTO(IFMATCH_A, NEXTOPER(NEXTOPER(scan))); /* NOTREACHED */ diff --git a/t/op/re_tests b/t/op/re_tests index 0992b15..a4f1e53 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -1358,3 +1358,5 @@ foo(\h)bar foo\tbar y $1 \t /^\s*i.*?o\s*$/s io\n io y - - # As reported in #59168 by Father Chrysostomos: /(.*?)a(?!(a+)b\2c)/ baaabaac y $&-$1 baa-ba +# [perl #60344] Regex lookbehind failure after an (if)then|else in perl 5.10 +/\A(?(?=db2)db2|\D+)(?