fix $^N-related coredump
Anton Berezin [Mon, 14 Jul 2003 13:50:35 +0000 (15:50 +0200)]
Message-ID: <20030714115035.GA10971@heechee.tobez.org>

p4raw-id: //depot/perl@20163

pp_hot.c
sv.c

index e781dcc..04442c9 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1406,7 +1406,7 @@ yup:                                      /* Confirmed by INTUIT */
        rx->startp[0] = s - truebase;
        rx->endp[0] = s - truebase + rx->minlen;
     }
-    rx->nparens = rx->lastparen = 0;   /* used by @- and @+ */
+    rx->nparens = rx->lastparen = rx->lastcloseparen = 0;      /* used by @-, @+, and $^N */
     LEAVE_SCOPE(oldsave);
     RETPUSHYES;
 
diff --git a/sv.c b/sv.c
index 59d0b12..251fd8a 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -11474,6 +11474,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
     PL_regstartp       = (I32*)NULL;
     PL_regendp         = (I32*)NULL;
     PL_reglastparen    = (U32*)NULL;
+    PL_reglastcloseparen       = (U32*)NULL;
     PL_regtill         = Nullch;
     PL_reg_start_tmp   = (char**)NULL;
     PL_reg_start_tmpl  = 0;