Test that `use feature' doesn't leak a scalar during s///ee
Josh ben Jore [Mon, 20 Jul 2009 14:39:25 +0000 (07:39 -0700)]
MANIFEST
t/lib/feature/leak [new file with mode: 0644]

index 9b2e198..6192dd0 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -4027,6 +4027,7 @@ t/lib/dprof/test8_v               Perl code profiler tests
 t/lib/dprof/V.pm               Perl code profiler tests
 t/lib/feature/bundle           Tests for feature bundles
 t/lib/feature/implicit         Tests for implicit loading of feature.pm
+t/lib/feature/leak             Tests for memory leaks
 t/lib/feature/nonesuch         Tests for enabling/disabling nonexistent feature
 t/lib/feature/say              Tests for enabling/disabling say feature
 t/lib/feature/switch           Tests for enabling/disabling switch feature
diff --git a/t/lib/feature/leak b/t/lib/feature/leak
new file mode 100644 (file)
index 0000000..fbd35f0
--- /dev/null
@@ -0,0 +1,12 @@
+Check that 'use feature' does not leak
+
+__END__
+# RT 63110 - Check that s///ee does not leak a hints variable
+use feature qw(:5.10);
+my $t;
+my $s = "a";
+$s =~ s/a/$t = \%^H;  qq( qq() );/ee;
+print Internals::SvREFCNT(%$t);
+
+EXPECT
+1