summaryrefslogtreecommitdiff
path: root/t/op/array.t
diff options
context:
space:
mode:
Diffstat (limited to 't/op/array.t')
-rwxr-xr-xt/op/array.t27
1 files changed, 26 insertions, 1 deletions
diff --git a/t/op/array.t b/t/op/array.t
index 472e02cd35..8f2f1a9510 100755
--- a/t/op/array.t
+++ b/t/op/array.t
@@ -1,6 +1,12 @@
#!./perl
-print "1..72\n";
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
+print "1..73\n";
#
# @foo, @bar, and @ary are also used from tie-stdarray after tie-ing them
@@ -247,3 +253,22 @@ sub tary {
@tary = (0..50);
tary();
+
+
+require './test.pl';
+
+# bugid #15439 - clearing an array calls destructors which may try
+# to modify the array - caused 'Attempt to free unreferenced scalar'
+
+my $got = runperl (
+ prog => q{
+ sub X::DESTROY { @a = () }
+ @a = (bless {}, 'X');
+ @a = ();
+ },
+ stderr => 1
+ );
+
+$got =~ s/\n/ /g;
+print "# $got\nnot " unless $got eq '';
+print "ok 73\n";