This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #115066] Fix wrongly nested ‘use’ deparsing
authorFather Chrysostomos <sprout@cpan.org>
Sat, 15 Nov 2014 17:56:50 +0000 (09:56 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 15 Nov 2014 18:58:52 +0000 (10:58 -0800)
B::Deparse was incorrectly putting ‘use’ statements and BEGIN blocks
inside other ‘use’ statements containing do-blocks, even if they were
originally outside.

Subroutines (except for cloned closures, which we don’t have to worry
about here) have an OUTSIDE pointer, pointing to the outer sub con-
taining the declaration of the sub in question.  So we can check that
to make sure we are putting the sub declaration in the right place.

Not only does this fix the reported case, but it also will allow
sequence numbers in inner subs to be reused by statements in outer
subs, which I may need in a future commit.


No differences found