This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #101486] Make PL_curstash refcounted
authorFather Chrysostomos <sprout@cpan.org>
Sat, 22 Oct 2011 18:06:35 +0000 (11:06 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 22 Oct 2011 23:09:59 +0000 (16:09 -0700)
commit03d9f026ae253e9e69212a3cf6f1944437e9f070
tree3c21bc6f46fb6b331a571f5c095fea8660fb1213
parentac73ea1ec401df889d312b067f78b618f7ffecc3
[perl #101486] Make PL_curstash refcounted

This stops PL_curstash from pointing to a freed-and-reused scalar in
cases like ‘package Foo; BEGIN {*Foo:: = *Bar::}’.

In such cases, another BEGIN block, or any subroutine definition,
would cause a crash.  Now it just happily proceeds.  newATTRSUB and
newXS have been modified not to call mro_method_changed_in in such
cases, as it doesn’t make sense.
ext/Opcode/Opcode.pm
ext/Opcode/Opcode.xs
op.c
perl.c
pp_ctl.c
sv.c
t/op/stash.t
win32/perlhost.h