diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2004-05-03 17:44:44 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2004-05-03 17:44:44 +0000 |
commit | e3a8873fee48db53bdab7f38729038b2eab97f0b (patch) | |
tree | edeb37260c0f914b7f8b81a2c6937904700b9723 /t/op | |
parent | cb3d361a49c18f4222090babc337a837a7616b69 (diff) | |
download | perl-e3a8873fee48db53bdab7f38729038b2eab97f0b.tar.gz |
[perl #28938] split could leave an array without &PL_sv_undef
in the unused elements
p4raw-id: //depot/perl@22774
Diffstat (limited to 't/op')
-rwxr-xr-x | t/op/split.t | 15 |
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'); +} + |