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.