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 /pp_hot.c | |
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 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1899,11 +1899,11 @@ PP(pp_iter) RETPUSHNO; if (SvMAGICAL(av) || AvREIFY(av)) { - SV ** const svp = av_fetch(av, cx->blk_loop.iterix--, FALSE); + SV ** const svp = av_fetch(av, --cx->blk_loop.iterix, FALSE); sv = svp ? *svp : Nullsv; } else { - sv = AvARRAY(av)[cx->blk_loop.iterix--]; + sv = AvARRAY(av)[--cx->blk_loop.iterix]; } } else { |