> [rafael - Thu Mar 11 15:28:45 2004]: > > [EMAIL PROTECTED] wrote: > > > > The patch below (to bleadperl, but also suitable for maint) should fix it. > > I'm not sure where we put threads-specific tests for things like this, > > but the example above is pretty close to an ideal test case. > > Regression tests for cloning... perhaps in t/op/clone ? > > > --- sv.c.old Wed Mar 10 20:59:52 2004 > > +++ sv.c Thu Mar 11 16:16:48 2004 > > @@ -9715,7 +9715,7 @@ > > New(0, ret->offsets, 2*len+1, U32); > > Copy(r->offsets, ret->offsets, 2*len+1, U32); > > > > - ret->precomp = SAVEPV(r->precomp); > > + ret->precomp = SAVEPVN(r->precomp, r->prelen); > > While we're at it, maybe this one is more complete : > (cargo-culting your fix) > > ==== //depot/perl/sv.c#726 - /opt/perl/p4/perl/sv.c ==== > --- /tmp/tmp.1393.0 Fri Mar 12 00:25:09 2004 > +++ /opt/perl/p4/perl/sv.c Fri Mar 12 00:25:02 2004 > @@ -9715,7 +9715,7 @@ > New(0, ret->offsets, 2*len+1, U32); > Copy(r->offsets, ret->offsets, 2*len+1, U32); > > - ret->precomp = SAVEPV(r->precomp); > + ret->precomp = SAVEPVN(r->precomp, r->prelen); > ret->refcnt = r->refcnt; > ret->minlen = r->minlen; > ret->prelen = r->prelen; > @@ -9727,7 +9727,7 @@ > ret->sublen = r->sublen; > > if (RX_MATCH_COPIED(ret)) > - ret->subbeg = SAVEPV(r->subbeg); > + ret->subbeg = SAVEPVN(r->subbeg, r->sublen); > else > ret->subbeg = Nullch; > #ifdef PERL_COPY_ON_WRITE > >
This fix was applied as change #22490.