diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-11-11 20:29:31 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-11-11 20:32:28 -0800 |
commit | b89cdb229b520dceadf180df9462c8a0a1edf975 (patch) | |
tree | 8a0be1856770d067e6569f7247f2c484bbec70a0 /proto.h | |
parent | eda19b455e8d9bb196ce7fa823d633ff077b2390 (diff) | |
download | perl-b89cdb229b520dceadf180df9462c8a0a1edf975.tar.gz |
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.
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -5671,11 +5671,12 @@ STATIC void S_mro_clean_isarev(pTHX_ HV * const isa, const char * const name, co #define PERL_ARGS_ASSERT_MRO_CLEAN_ISAREV \ assert(isa); assert(name) -STATIC void S_mro_gather_and_rename(pTHX_ HV * const stashes, HV *stash, HV *oldstash, const char *name, I32 namlen) +STATIC void S_mro_gather_and_rename(pTHX_ HV * const stashes, HV * const seen_stashes, HV *stash, HV *oldstash, const char *name, I32 namlen) __attribute__nonnull__(pTHX_1) - __attribute__nonnull__(pTHX_4); + __attribute__nonnull__(pTHX_2) + __attribute__nonnull__(pTHX_5); #define PERL_ARGS_ASSERT_MRO_GATHER_AND_RENAME \ - assert(stashes); assert(name) + assert(stashes); assert(seen_stashes); assert(name) STATIC AV* S_mro_get_linear_isa_dfs(pTHX_ HV* stash, U32 level) __attribute__nonnull__(pTHX_1); |