From: Rafael Garcia-Suarez Date: Mon, 19 Feb 2007 13:08:03 +0000 (+0000) Subject: Revert change #30081 at dmq's request, and mark its tests X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dd5def096b7b2dabfe2022669c29c16240d7da96;p=p5sagit%2Fp5-mst-13.2.git Revert change #30081 at dmq's request, and mark its tests as TODO. (This should restore compilation with g++) p4raw-link: @30081 on //depot/perl: ded05c2a789e70bb7204e21b2aa98c6d1ac776c2 p4raw-id: //depot/perl@30351 --- diff --git a/ext/re/lib/re/Tie/Hash/NamedCapture.pm b/ext/re/lib/re/Tie/Hash/NamedCapture.pm index b86463d..a76c6ab 100644 --- a/ext/re/lib/re/Tie/Hash/NamedCapture.pm +++ b/ext/re/lib/re/Tie/Hash/NamedCapture.pm @@ -2,7 +2,6 @@ package re::Tie::Hash::NamedCapture; use strict; use warnings; our $VERSION = "0.01"; -no re 'debug'; use re qw(is_regexp regname regnames diff --git a/ext/re/re.pm b/ext/re/re.pm index 4f8d410..4a64af3 100644 --- a/ext/re/re.pm +++ b/ext/re/re.pm @@ -138,7 +138,6 @@ sub bits { } elsif ($s eq 'debug' or $s eq 'debugcolor') { setcolor() if $s =~/color/i; _load_unload($on); - last; } elsif (exists $bitmask{$s}) { $bits |= $bitmask{$s}; } elsif ($EXPORT_OK{$s}) { diff --git a/regcomp.c b/regcomp.c index 197ab12..6ea593e 100644 --- a/regcomp.c +++ b/regcomp.c @@ -4710,9 +4710,8 @@ Perl_reg_named_buff_get(pTHX_ const REGEXP * const rx, SV* namesv, U32 flags) SV* sv_dat=HeVAL(he_str); I32 *nums=(I32*)SvPVX(sv_dat); for ( i=0; inparens) >= nums[i] - && rx->startp[nums[i]] != -1 - && rx->endp[nums[i]] != -1) + if ((I32)(rx->lastparen) >= nums[i] && + rx->endp[nums[i]] != -1) { ret = CALLREG_NUMBUF(rx,nums[i],NULL); if (!retarray) diff --git a/regexec.c b/regexec.c index daa8e00..e8e0e2a 100644 --- a/regexec.c +++ b/regexec.c @@ -2142,8 +2142,6 @@ phooey: } - - /* - regtry - try match at specific point */ @@ -3596,9 +3594,6 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog) } else { nochange_depth = 0; } - { regexp *ocurpm = PM_GETRE(PL_curpm); - char *osubbeg = rex->subbeg; - STRLEN osublen = rex->sublen; { /* execute the code in the {...} */ dSP; @@ -3606,7 +3601,6 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog) OP_4tree * const oop = PL_op; COP * const ocurcop = PL_curcop; PAD *old_comppad; - n = ARG(scan); PL_op = (OP_4tree*)rexi->data->data[n]; @@ -3619,10 +3613,6 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog) SV *sv_mrk = get_sv("REGMARK", 1); sv_setsv(sv_mrk, sv_yes_mark); } - /* make sure that $1 and friends are available with nested eval */ - PM_SETRE(PL_curpm,rex); - rex->subbeg = ocurpm->subbeg; - rex->sublen = ocurpm->sublen; CALLRUNOPS(aTHX); /* Scalar context. */ SPAGAIN; @@ -3636,7 +3626,6 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog) PL_op = oop; PAD_RESTORE_LOCAL(old_comppad); PL_curcop = ocurcop; - if (!logical) { /* /(?{...})/ */ sv_setsv(save_scalar(PL_replgv), ret); @@ -3682,12 +3671,6 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog) } } rei = RXi_GET(re); - - /* restore PL_curpm after the eval */ - PM_SETRE(PL_curpm,ocurpm); - rex->sublen = osublen; - rex->subbeg = osubbeg; - DEBUG_EXECUTE_r( debug_start_match(re, do_utf8, locinput, PL_regeol, "Matching embedded"); @@ -3701,8 +3684,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog) Renew(PL_reg_start_tmp, PL_reg_start_tmpl, char*); else Newx(PL_reg_start_tmp, PL_reg_start_tmpl, char*); - } - + } eval_recurse_doit: /* Share code with GOSUB below this line */ /* run the pattern returned from (??{...}) */ @@ -3739,11 +3721,6 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog) PUSH_YES_STATE_GOTO(EVAL_AB, startpoint); /* NOTREACHED */ } - /* restore PL_curpm after the eval */ - PM_SETRE(PL_curpm,ocurpm); - rex->sublen = osublen; - rex->subbeg = osubbeg; - } /* logical is 1, /(?(?{...})X|Y)/ */ sw = (bool)SvTRUE(ret); logical = 0; diff --git a/t/op/pat.t b/t/op/pat.t index 46900e8..fe2eef6 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -4267,11 +4267,11 @@ sub kt $re = qr/^ ( (??{ $grabit }) ) $ /x; my @res = '0902862349' =~ $re; iseq(join("-",@res),"0902862349", - 'PL_curpm is set properly on nested eval'); + 'PL_curpm is set properly on nested eval # TODO'); our $qr = qr/ (o) (??{ $1 }) /x; ok( 'boob'=~/( b (??{ $qr }) b )/x && 1, - "PL_curpm, nested eval"); + "PL_curpm, nested eval # TODO"); } {