This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
make op.c:S_find_and_forget_pmops() non-recursive
For every CV that's freed which has a shared optree (e.g. a closure
or between threads), the whole optree is walked looking for PMOPs.
Make that walk non-recursive.
Contrived code that triggers a stack overflow:
{
my $outer;
my $e = 'sub { $outer && '
. join('&&', ('$x') x 100_000)
. " }";
#print $e, "\n";
eval $e;
}
Even after this commit, that code still SEGVs due to a separate stack
blow in Perl_rpeep().