summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2008-02-17 16:53:27 +0000
committerYves Orton <demerphq@gmail.com>2008-02-17 16:53:27 +0000
commit250257bbff1fc2894d6e73059be5be21b4ea00a4 (patch)
treec8518e0e98a33992db46ed32a99159a2fbd1d07d /regcomp.c
parent639081d6f95c9b3121be1c0c372070f2e0ca4eaf (diff)
downloadperl-250257bbff1fc2894d6e73059be5be21b4ea00a4.tar.gz
Fix bug 50496 -- regcomp.c=~s/lastcloseparen/lastparen/g
-- lastcloseparen is literally the index of the last paren closed -- lastparen is index of the highest index paren that has been closed. In nested parens, they will be completely different. 'ab'=~/(a(b))/ will have: lastparen = 2, lastcloseparen = 1 'ab'=~/(a)(b)/ will have: lastparen = lastcloseparen = 2 p4raw-id: //depot/perl@33325
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/regcomp.c b/regcomp.c
index c4313ae2fc..5c0563542d 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -5042,6 +5042,7 @@ SV*
Perl_reg_named_buff_nextkey(pTHX_ REGEXP * const r, const U32 flags)
{
struct regexp *const rx = (struct regexp *)SvANY(r);
+ GET_RE_DEBUG_FLAGS_DECL;
PERL_ARGS_ASSERT_REG_NAMED_BUFF_NEXTKEY;
@@ -5054,7 +5055,7 @@ Perl_reg_named_buff_nextkey(pTHX_ REGEXP * const r, const U32 flags)
SV* sv_dat = HeVAL(temphe);
I32 *nums = (I32*)SvPVX(sv_dat);
for ( i = 0; i < SvIVX(sv_dat); i++ ) {
- if ((I32)(rx->lastcloseparen) >= nums[i] &&
+ if ((I32)(rx->lastparen) >= nums[i] &&
rx->offs[nums[i]].start != -1 &&
rx->offs[nums[i]].end != -1)
{
@@ -5114,7 +5115,7 @@ Perl_reg_named_buff_all(pTHX_ REGEXP * const r, const U32 flags)
SV* sv_dat = HeVAL(temphe);
I32 *nums = (I32*)SvPVX(sv_dat);
for ( i = 0; i < SvIVX(sv_dat); i++ ) {
- if ((I32)(rx->lastcloseparen) >= nums[i] &&
+ if ((I32)(rx->lastparen) >= nums[i] &&
rx->offs[nums[i]].start != -1 &&
rx->offs[nums[i]].end != -1)
{