[perl #76716]
commits
044d8c24f and 64345bb broke backrefs to hashes that are merely
cleared or undeffed, but not freed. Spotted by Father Chrysostomos.
Test for it here (fixes coming next)
# use strict;
-plan tests => 215;
+plan tests => 217;
my @comma = ("key", "value");
@expect{map "$_", @refs} = @types;
ok (eq_hash(\%h, \%expect), 'blessed ref stringification');
}
+
+# [perl #76716] Hash assignment should not zap weak refs.
+{
+ my %tb;
+ use Scalar::Util;
+ Scalar::Util::weaken(my $p = \%tb);
+ %tb = ();
+ is $p, \%tb, "hash assignment should not zap weak refs";
+ undef %tb;
+ is $p, \%tb, "hash undef should not zap weak refs";
+}