Fix skip logic in pad_tidy and cv_clone
Commit
325e1816dc changed the logic for determining whether a pad
entry is to be treated like a constant; i.e., shared between recursion
levels and sub clones.
According the old logic, a pad entry must be shared if it is marked
READONLY or is a shared hash key scalar. According to the new logic,
the entry must be shared if the pad name has a zero-length PV (i.e.,
&PL_sv_no).
Two pieces of code were still following the old logic. Changing them
fixes this old bug:
my $close_over_me;
sub {
() = $close_over_me;
open my $fh, "/dev/null";
print "$$fh\n"
}->();
__END__
Output:
*main::
The name attached to the implicit rv2gv op in open() was not being
copied by sub clones.
The previous commit is also part of the fix.
In the tests, I tested the combination of sub cloning and recursion,
since it seemed like a good idea (and also as a result of copying and
pasting :-).
S_pmtrans was still relying on the old logic, so it gets changed, too.