summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-05-17 20:06:23 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-05-17 20:06:23 +0000
commitd42935ef34d556a685dfe8f03d2f6053a0b554ee (patch)
tree8e30259df8207ced3269a87b80979d57a8b9ff9f /pp_hot.c
parent026b9da668ef80098c6605ecf2edb65546562c4e (diff)
downloadperl-d42935ef34d556a685dfe8f03d2f6053a0b554ee.tar.gz
Integrate #10145 from maintperl.
fix for ID 20010515.004 (needs test) p4raw-id: //depot/perl@10148 p4raw-integrated: from //depot/maint-5.6/perl@10147 'merge in' pp_hot.c (@10091..)
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 023a05baf8..9e484fca88 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1812,9 +1812,17 @@ PP(pp_iter)
SvREFCNT_dec(*itersvp);
- if ((sv = SvMAGICAL(av)
- ? *av_fetch(av, ++cx->blk_loop.iterix, FALSE)
- : AvARRAY(av)[++cx->blk_loop.iterix]))
+ if (SvMAGICAL(av) || AvREIFY(av)) {
+ SV **svp = av_fetch(av, ++cx->blk_loop.iterix, FALSE);
+ if (svp)
+ sv = *svp;
+ else
+ sv = Nullsv;
+ }
+ else {
+ sv = AvARRAY(av)[++cx->blk_loop.iterix];
+ }
+ if (sv)
SvTEMP_off(sv);
else
sv = &PL_sv_undef;