summaryrefslogtreecommitdiff
path: root/gv.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-11-25 22:15:33 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-11-29 09:11:30 -0800
commit6e1b2de7c59099adaa1866fe94957b98fabcd9c4 (patch)
treee239ecfe943c3c05c39a4f8d78865a859e762fab /gv.h
parentb01425c33956a0b279a0f20ced4131027f2c40f4 (diff)
downloadperl-6e1b2de7c59099adaa1866fe94957b98fabcd9c4.tar.gz
Fix two minor bugs with local glob assignment
These are combined into one patch because it is hard to fix one with- out fixing the other. local *glob = $ref was ignoring the clobbered reference and not accounting for when updating ISA caches, resulting in two bugs: *Foo::ISA = *Bar::ISA; @Foo::ISA = "Baz"; sub Baz::ook { "Baz" } sub L::ook { "See" } warn Bar->ook; # Baz local *Foo::ISA = ["L"]; warn Bar->ook; # Baz @Baz::ISA = @Baz::ISA; # should have no effect warn Bar->ook; # See @Baz::ISA = "Foo::bar"; sub Foo::bar::ber { 'baz' } sub UNIVERSAL::ber { "black sheep" } warn Baz->ber; # baz local *Foo:: = \%Bar::; warn Baz->ber; # baz @Baz::ISA = @Baz::ISA; # should have no effect warn Baz->ber; # black sheep The dref variable in sv.c:S_glob_assign_ref holds the SV that needs to be freed. So during localisation it is NULL. When I was fixing up isa and mro bugs in perl 5.14, I misunderstood its purpose and thought it always contained the reference on the left. Since we need to have access to what was assigned over after the assignment, this commit changes dref always to hold the clobbered SV, and makes the SvREFCNT_dec conditional.
Diffstat (limited to 'gv.h')
0 files changed, 0 insertions, 0 deletions