This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix assert fail with my $x; sub() {$x}
If $x is not referenced or used in lvalue context elsewhere, then the
constant sub can actually share the same scalar as the enclosing sub’s
pad. It doesn’t need to copy. And we don’t in that case, as of
v5.21.5-421-g04472a8. But we need to make sure the PADTMP flag is
turned off at scope exit if the pad has the only reference to the sub.
(The PADTMP flag has been turned on as of v5.21.5-391-g5543332.)