summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2005-11-22 16:32:42 +0000
committerDave Mitchell <davem@fdisolutions.com>2005-11-22 16:32:42 +0000
commit6e585ca0b32392d502ae4276faab9761cc9b1188 (patch)
tree4478db7ed5be6ce4a71d47e6edae1acc8836e113 /pp_hot.c
parentc106e8bbff313f9d3ffd1a9a1b0a6bd6129af87b (diff)
downloadperl-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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 312eef7854..173aca287d 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -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 {