This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix package assignment with nested aliased packages
authorFather Chrysostomos <sprout@cpan.org>
Fri, 12 Nov 2010 04:29:31 +0000 (20:29 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 12 Nov 2010 04:32:28 +0000 (20:32 -0800)
commitb89cdb229b520dceadf180df9462c8a0a1edf975
tree8a0be1856770d067e6569f7247f2c484bbec70a0
parenteda19b455e8d9bb196ce7fa823d633ff077b2390
Fix package assignment with nested aliased packages

This commit fixes package assignments like *foo:: = *bar:: when both
foo and bar contain nested stashes that are aliases of each other.

mro_package_moved (actually, its auxiliary routine) need to keep a
list of stashes that have been seen as a separate list from those that
are going to have mro_isa_changed_in called on them. Otherwise, some
stashes will simply not be iterated through.

See the test that this adds and its comments. @ISA = @ISA should never
have any effect visible to Perl (with a capital), but it does in that
test case, prior to this commit.

This also fixes another bug that the test case triggered:
riter was not being reset before the second iteration in
mro_gather_and_rename.

Also, the stashes HV (aka the ‘big list’) now holds refcounts on its
elements, as that makes the code simpler as a result of the changes.
embed.fnc
embed.h
mro.c
proto.h
t/mro/package_aliases.t