From: Rafael Garcia-Suarez Date: Mon, 19 Feb 2007 13:41:41 +0000 (+0000) Subject: Actually, only changes to regexec.c from #30081 needed to be reverted. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=66e6b4c55568ab053eb52b573c61e4e3f9235b32;p=p5sagit%2Fp5-mst-13.2.git Actually, only changes to regexec.c from #30081 needed to be reverted. p4raw-id: //depot/perl@30352 --- diff --git a/ext/re/lib/re/Tie/Hash/NamedCapture.pm b/ext/re/lib/re/Tie/Hash/NamedCapture.pm index a76c6ab..b86463d 100644 --- a/ext/re/lib/re/Tie/Hash/NamedCapture.pm +++ b/ext/re/lib/re/Tie/Hash/NamedCapture.pm @@ -2,6 +2,7 @@ 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 4a64af3..4f8d410 100644 --- a/ext/re/re.pm +++ b/ext/re/re.pm @@ -138,6 +138,7 @@ 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 6ea593e..b42cbbd 100644 --- a/regcomp.c +++ b/regcomp.c @@ -4710,8 +4710,9 @@ 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; ilastparen) >= nums[i] && - rx->endp[nums[i]] != -1) + if ((I32)(rx->nparens) >= nums[i] + && rx->startp[nums[i]] != -1 + && rx->endp[nums[i]] != -1) { ret = CALLREG_NUMBUF(rx,nums[i],NULL); if (!retarray)