diff options
author | Yves Orton <demerphq@gmail.com> | 2008-02-17 16:53:27 +0000 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2008-02-17 16:53:27 +0000 |
commit | 250257bbff1fc2894d6e73059be5be21b4ea00a4 (patch) | |
tree | c8518e0e98a33992db46ed32a99159a2fbd1d07d /regcomp.c | |
parent | 639081d6f95c9b3121be1c0c372070f2e0ca4eaf (diff) | |
download | perl-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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) { |