diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-10-29 20:45:34 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-10-29 21:50:24 -0700 |
commit | 00169e2cdde29138824a7bf6b66d5875aaa8278d (patch) | |
tree | aeb3b50ba3698ec9d26053d42e414fda70a983ba /pp.c | |
parent | bc56db2a697ebe59892fabdcfa5aa910ed4f2885 (diff) | |
download | perl-00169e2cdde29138824a7bf6b66d5875aaa8278d.tar.gz |
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.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -854,11 +854,11 @@ PP(pp_undef) HV *stash; /* undef *Foo:: */ - if((stash = GvHV((const GV *)sv)) && HvNAME_get(stash)) + if((stash = GvHV((const GV *)sv)) && HvENAME_get(stash)) mro_isa_changed_in(stash); /* undef *Pkg::meth_name ... */ else if(GvCVu((const GV *)sv) && (stash = GvSTASH((const GV *)sv)) - && HvNAME_get(stash)) + && HvENAME_get(stash)) mro_method_changed_in(stash); gp_free(MUTABLE_GV(sv)); |