In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/af534a0431cd837092de9abe4bff29feeeafebb3?hp=1c8f8eb1d500716bc7368dab00869ae3be841e0c>

- Log -----------------------------------------------------------------
commit af534a0431cd837092de9abe4bff29feeeafebb3
Author: Nicholas Clark <[email protected]>
Date:   Sat May 29 22:07:04 2010 +0100

    Properly free paren_name_list with its regexp.
    
    Previously the AV paren_name_list would "leak" until global destruction.
    This was only an issue under -DDEBUGGING. Fixes RT #73438.
-----------------------------------------------------------------------

Summary of changes:
 regcomp.c |    6 ++++--
 regcomp.h |    1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/regcomp.c b/regcomp.c
index ff9c582..0a343ec 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -4945,7 +4945,7 @@ reStudy:
 #endif
 #ifdef DEBUGGING
     if (RExC_paren_names) {
-        ri->name_list_idx = add_data( pRExC_state, 1, "p" );
+        ri->name_list_idx = add_data( pRExC_state, 1, "a" );
         ri->data->data[ri->name_list_idx] = 
(void*)SvREFCNT_inc(RExC_paren_name_list);
     } else
 #endif
@@ -9556,6 +9556,7 @@ Perl_regfree_internal(pTHX_ REGEXP * const rx)
        while (--n >= 0) {
           /* If you add a ->what type here, update the comment in regcomp.h */
            switch (ri->data->what[n]) {
+           case 'a':
            case 's':
            case 'S':
            case 'u':
@@ -9789,8 +9790,9 @@ Perl_regdupe_internal(pTHX_ REGEXP * const rx, 
CLONE_PARAMS *param)
        for (i = 0; i < count; i++) {
            d->what[i] = ri->data->what[i];
            switch (d->what[i]) {
-               /* legal options are one of: sSfpontTu
+               /* legal options are one of: sSfpontTua
                   see also regcomp.h and pregfree() */
+           case 'a': /* actually an AV, but the dup function is identical.  */
            case 's':
            case 'S':
            case 'p': /* actually an AV, but the dup function is identical.  */
diff --git a/regcomp.h b/regcomp.h
index ad9a2cc..1ef9d2d 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -476,6 +476,7 @@ END_EXTERN_C
 
 /* .what is a character array with one character for each member of .data
  * The character describes the function of the corresponding .data item:
+ *   a - AV for paren_name_list under DEBUGGING
  *   f - start-class data for regstclass optimization
  *   n - Root of op tree for (?{EVAL}) item
  *   o - Start op for (?{EVAL}) item

--
Perl5 Master Repository

Reply via email to