av_delete() wasn't mortalizing the returned value
p4raw-id: //depot/perl@23158
SvREFCNT_dec(sv);
sv = Nullsv;
}
+ else
+ sv = sv_2mortal(sv);
return sv;
}
#!./perl
-print "1..37\n";
+print "1..38\n";
# delete() on hash elements
print "not " if defined $y;
print "ok 37\n";
}
+
+{
+ # [perl #30733] array delete didn't free returned element
+ my $x = 0;
+ sub X::DESTROY { $x++ }
+ {
+ my @a;
+ $a[0] = bless [], 'X';
+ my $y = delete $a[0];
+ }
+ print "not " unless $x == 1;
+ print "ok 38\n";
+}