summaryrefslogtreecommitdiff
path: root/t/op
diff options
context:
space:
mode:
Diffstat (limited to 't/op')
-rwxr-xr-xt/op/split.t15
1 files changed, 14 insertions, 1 deletions
diff --git a/t/op/split.t b/t/op/split.t
index 957da24950..31a2f51bf9 100755
--- a/t/op/split.t
+++ b/t/op/split.t
@@ -6,7 +6,7 @@ BEGIN {
require './test.pl';
}
-plan tests => 54;
+plan tests => 55;
$FS = ':';
@@ -289,3 +289,16 @@ ok(@ary == 3 &&
$n = @a = split /,/,$p;
is ($n, 0, '#21765 - pmreplroot hack used to return undef for 0 iters');
}
+
+{
+ # [perl #28938]
+ # assigning off the end of the array after a split could leave garbage
+ # in the inner elements
+
+ my $x;
+ @a = split /,/, ',,,,,';
+ $a[3]=1;
+ $x = \$a[2];
+ is (ref $x, 'SCALAR', '#28938 - garbage after extend');
+}
+