From b89cdb229b520dceadf180df9462c8a0a1edf975 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Thu, 11 Nov 2010 20:29:31 -0800 Subject: Fix package assignment with nested aliased packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'embed.h') diff --git a/embed.h b/embed.h index 0d70e87f9c..64c352c4a6 100644 --- a/embed.h +++ b/embed.h @@ -1639,7 +1639,7 @@ # endif # if defined(PERL_IN_MRO_C) #define mro_clean_isarev(a,b,c,d) S_mro_clean_isarev(aTHX_ a,b,c,d) -#define mro_gather_and_rename(a,b,c,d,e) S_mro_gather_and_rename(aTHX_ a,b,c,d,e) +#define mro_gather_and_rename(a,b,c,d,e,f) S_mro_gather_and_rename(aTHX_ a,b,c,d,e,f) #define mro_get_linear_isa_dfs(a,b) S_mro_get_linear_isa_dfs(aTHX_ a,b) # endif # if defined(PERL_IN_NUMERIC_C) -- cgit v1.2.1