Change 32754 by [EMAIL PROTECTED] on 2007/12/28 22:01:30

        Silly Nick. There was a bug in change 30757 whereby the precomp of a
        dup'd regexp would be pointing somewhere la-la. Probably at the precomp
        of the same regexp in the parent thread. (So it is only likely to go
        nasal daemon if the parent thread terminates first, or explicitly goes
        around freeing up run time generated regexps.)

Affected files ...

... //depot/perl/regcomp.c#623 edit

Differences ...

==== //depot/perl/regcomp.c#623 (text) ====
Index: perl/regcomp.c
--- perl/regcomp.c#622~32753~   2007-12-28 13:25:50.000000000 -0800
+++ perl/regcomp.c      2007-12-28 14:01:30.000000000 -0800
@@ -9371,6 +9371,7 @@
     dVAR;
     regexp *ret;
     I32 npar;
+    U32 precomp_offset;
 
     if (!r)
        return (REGEXP *)NULL;
@@ -9419,8 +9420,10 @@
        }
     }
 
+    precomp_offset = RX_PRECOMP(ret) - ret->wrapped;
+
     ret->wrapped        = SAVEPVN(ret->wrapped, ret->wraplen+1);
-    RX_PRECOMP(ret)        = ret->wrapped + (RX_PRECOMP(ret) - ret->wrapped);
+    RX_PRECOMP(ret)     = ret->wrapped + precomp_offset;
     ret->paren_names    = hv_dup_inc(ret->paren_names, param);
 
     if (ret->pprivate)
End of Patch.

Reply via email to