summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-10-25 14:48:56 -0700
committerFather Chrysostomos <sprout@cpan.org>2010-10-25 16:16:34 -0700
commite0a523956a6a1b27028abe71c6dee3628fa57e63 (patch)
tree764073abf8f87acb4433d899402b9603e045892f /hv.c
parent60b22aca14742ead2388ca3c7bb4b542a2d9a4b1 (diff)
downloadperl-e0a523956a6a1b27028abe71c6dee3628fa57e63.tar.gz
Fix @ISA recursion during global destruction
With -DDEBUGGING and make test (not make test_harness): Failed 3 tests out of 1889, 99.84% okay. mro/basic.t mro/recursion_c3.t mro/recursion_dfs.t See <http://www.nntp.perl.org/group/perl.perl5.porters/2010/10/msg165311.html>. This was broken by change 35759254, which made S_hv_delete_common call mro_package_moved when the G_DISCARD flag was passed. It used to be skipped, which was a mistake. This commit simply skips mro_package_moved when $::{"main::"} is deleted. It was buggy anyway (main::E being passed to recursive calls, instead of E), and should only happen at global destruction. (If $::{"main::"} is deleted at run-time, it stop Perl from being func- tional, so no one should be doing that.)
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hv.c b/hv.c
index 13968b4b3c..543b6ea5a3 100644
--- a/hv.c
+++ b/hv.c
@@ -1024,6 +1024,7 @@ S_hv_delete_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
if (HeVAL(entry) && HvNAME(hv)) {
if (keysv) key = SvPV(keysv, klen);
if (klen > 1 && key[klen-2] == ':' && key[klen-1] == ':'
+ && (klen != 6 || hv!=PL_defstash || memNE(key,"main::",6))
&& SvTYPE(HeVAL(entry)) == SVt_PVGV) {
HV * const stash = GvHV((GV *)HeVAL(entry));
if (stash && HvNAME(stash))