From: Jarkko Hietaniemi Date: Thu, 17 May 2001 20:06:23 +0000 (+0000) Subject: Integrate #10145 from maintperl. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d42935ef34d556a685dfe8f03d2f6053a0b554ee;p=p5sagit%2Fp5-mst-13.2.git 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..) --- diff --git a/pp_hot.c b/pp_hot.c index 023a05b..9e484fc 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;