lastparen in the regexp structure is never initialised, and so will
authorNicholas Clark <nick@ccl4.org>
Wed, 8 Feb 2006 20:57:24 +0000 (20:57 +0000)
committerNicholas Clark <nick@ccl4.org>
Wed, 8 Feb 2006 20:57:24 +0000 (20:57 +0000)
still be uninitialised after a failed match, yet various points in
mg.c read it come what may. Should fix bug 38461.

p4raw-id: //depot/perl@27133

regcomp.c

index 12bfc1c..8bcfb8f 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -2870,6 +2870,7 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm)
 #endif
     r->reganch = pm->op_pmflags & PMf_COMPILETIME;
     r->nparens = RExC_npar - 1;        /* set early to validate backrefs */
+    r->lastparen = 0;                  /* mg.c reads this.  */
 
     r->substrs = 0;                    /* Useful during FAIL. */
     r->startp = 0;                     /* Useful during FAIL. */