From: Ilya Zakharevich Date: Wed, 29 Sep 1999 18:29:52 +0000 (-0400) Subject: (Removed by #4262.) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d39bda52bf2a9b53e6d633ed28f3354ef5b6ccac;p=p5sagit%2Fp5-mst-13.2.git (Removed by #4262.) To: desar@club-internet.fr (François Désarménien) Cc: perl5-porters@perl.org (perl5-porters@perl.org) Subject: Re: Strange RE engine breakage in 5_61 Message-Id: <199909292229.SAA18917@monk.mps.ohio-state.edu> p4raw-id: //depot/cfgperl@4252 --- diff --git a/regexec.c b/regexec.c index a567353..6981424 100644 --- a/regexec.c +++ b/regexec.c @@ -739,19 +739,23 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char * /* If there is a "must appear" string, look for it. */ s = startpos; - if (prog->reganch & ROPT_GPOS_SEEN) { + if (prog->reganch & ROPT_GPOS_SEEN) { /* Need to have PL_reg_ganch */ MAGIC *mg; - if (!(flags & REXEC_IGNOREPOS) && sv && SvTYPE(sv) >= SVt_PVMG - && SvMAGIC(sv) && (mg = mg_find(sv, 'g')) && mg->mg_len >= 0) - PL_reg_ganch = strbeg + mg->mg_len; - else + if (flags & REXEC_IGNOREPOS) PL_reg_ganch = startpos; - if (prog->reganch & ROPT_ANCH_GPOS) { - if (s > PL_reg_ganch) - goto phooey; - s = PL_reg_ganch; + else if (sv && SvTYPE(sv) >= SVt_PVMG + && SvMAGIC(sv) + && (mg = mg_find(sv, 'g')) && mg->mg_len >= 0) { + PL_reg_ganch = strbeg + mg->mg_len; /* Defined pos() */ + if (prog->reganch & ROPT_ANCH_GPOS) { + if (s > PL_reg_ganch) + goto phooey; + s = PL_reg_ganch; + } } + else + PL_reg_ganch = strbeg; } if (!(flags & REXEC_CHECKED) && prog->check_substr != Nullsv) { diff --git a/t/op/re_tests b/t/op/re_tests index b35e964..e899454 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -739,3 +739,4 @@ tt+$ xxxtt y - - [\w-z] - c - /[\w-z]/: invalid [] range in regexp [0-[:digit:]] - c - /[0-[:digit:]]/: invalid [] range in regexp [[:digit:]-9] - c - /[[:digit:]-9]/: invalid [] range in regexp +\GX.X aaaXbX n - -