This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [NL-PM] Fw: [PATCH - provisional] H. Merijn Brands idea of buffer numbering.
authorYves Orton <demerphq@gmail.com>
Fri, 9 Feb 2007 20:40:17 +0000 (21:40 +0100)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Fri, 9 Feb 2007 20:06:44 +0000 (20:06 +0000)
Message-ID: <9b18b3110702091140k12d60712uf9fffbf77141247c@mail.gmail.com>

p4raw-id: //depot/perl@30184

regcomp.c

index 27063a7..c526c3a 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -5609,7 +5609,9 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
            if (!SIZE_ONLY ){
                if (!RExC_nestroot) 
                    RExC_nestroot = parno;
-               if (RExC_seen & REG_SEEN_RECURSE) {
+               if (RExC_seen & REG_SEEN_RECURSE
+                   && !RExC_open_parens[parno-1])
+               {
                    DEBUG_OPTIMISE_MORE_r(PerlIO_printf(Perl_debug_log,
                        "Setting open paren #%"IVdf" to %d\n", 
                        (IV)parno, REG_NODE_NUM(ret)));