diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2005-11-22 16:32:42 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2005-11-22 16:32:42 +0000 |
commit | 6e585ca0b32392d502ae4276faab9761cc9b1188 (patch) | |
tree | 4478db7ed5be6ce4a71d47e6edae1acc8836e113 /t | |
parent | c106e8bbff313f9d3ffd1a9a1b0a6bd6129af87b (diff) | |
download | perl-6e585ca0b32392d502ae4276faab9761cc9b1188.tar.gz |
[perl #37725] perl segfaults on reversed array reference
The 'for (reverse @a)' optimisation got its index wrong when
create LVALUE SVs for undef elements
p4raw-id: //depot/perl@26195
Diffstat (limited to 't')
-rw-r--r-- | t/op/loopctl.t | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/t/op/loopctl.t b/t/op/loopctl.t index 11fb7c8ef7..a8e23107cb 100644 --- a/t/op/loopctl.t +++ b/t/op/loopctl.t @@ -31,7 +31,7 @@ # # -- .robin. <robin@kitsite.com> 2001-03-13 -print "1..46\n"; +print "1..47\n"; my $ok; @@ -992,3 +992,16 @@ print ($ok ? "ok 41\n" : "not ok 41\n"); } } + +{ + # [perl #37725] + + $a37725[3] = 1; # use package var + $i = 2; + for my $x (reverse @a37725) { + $x = $i++; + } + print "@a37725" == "5 4 3 2" ? "" : "not ", + "ok 47 - reverse with empty slots (@a37725)\n"; +} + |