PERL PERL5 PORTERS 22 RE PERL 32968 PATCH RE B WALKOPTREE SEGFAULTS
Date: Fri, 18 Feb 2005 17:15:26 +0100

Subject: Re: [perl #32968] [PATCH] Re: B::walkoptree segfaults
From: rgarciasuarez@no-spam (Rafael Garcia-Suarez)

Stephen McCamant wrote:
> It appears there were two problems with walkoptree and pmreplroot:
> first, there was a logic error in the previous addition of pmreplroot > support: the code was claiming that the pmreplroot kid of the OP was a > always PMOP, while in general it isn't: it's only the *parent* we know > to be a PMOP in this branch. This was causing a segfault on a s///.
> > The second problem was analogous to the change needed in > walkoptree_slow: when the OP is an OP_PUSHRE (the regex in a split()),
> the replroot is sometimes reused to store a pointer to the array being > split into, either as a GV* or as a PADOFFSET under ithreads. In that > case, walkoptree shouldn't recurse. The second hunk adds a comment to > op.h mentioning this weirdness. As the comment implies, it would be > even better documentation to change the code to achieve the reuse with > a union rather than with casts, but maybe that's more work than it's > worth.

Thanks, applied as change 23983 to bleadperl (after a long delay, sorry...)