This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Switch the core MRO code over to HvENAME
authorFather Chrysostomos <sprout@cpan.org>
Sat, 30 Oct 2010 03:45:34 +0000 (20:45 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 30 Oct 2010 04:50:24 +0000 (21:50 -0700)
commit00169e2cdde29138824a7bf6b66d5875aaa8278d
treeaeb3b50ba3698ec9d26053d42e414fda70a983ba
parentbc56db2a697ebe59892fabdcfa5aa910ed4f2885
Switch the core MRO code over to HvENAME

This has the side-effect of fixing these one-liners:

$ perl5.13.5 -le' my $glob = \*foo::ISA; delete $::{"foo::"}; *$glob = *a'
Bus error
$ perl5.13.5 -le' my $glob = \*foo::ISA; delete $::{"foo::"}; *$glob = []'
Bus error
$ perl5.13.6 -le'sub baz; my $glob = \*foo::bar; delete $::{"foo::"}; *$glob = *baz;'
Bus error
$ perl5.13.6 -le'sub foo::bar; my $glob = \*foo::bar; delete $::{"foo::"}; *$glob = *baz;'
Bus error

In the first two cases the crash was inadvertently fixed (isn’t it
nice when that happens?) in 5.13.6 (by 6f86b615fa7), but there was
still a fatal error:
Can't call mro_isa_changed_in() on anonymous symbol table at -e line 1.

Because sv_clear calls ->DESTROY, if an object’s stash has been
detached from the symbol table, mro_get_linear_isa can be called on a
hash with no HvENAME. So HvNAME is used as a fallback for those cases.
hv.c
mg.c
mro.c
pp.c
scope.c
sv.c