From: David Mitchell Date: Tue, 13 Nov 2012 10:57:35 +0000 (+0000) Subject: pp_iter: move RETPUSHYES outside switch X-Git-Tag: upstream/5.20.0~4812^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=17c916408b4fa9ea0f555e5583672e6aa22f49cf;p=platform%2Fupstream%2Fperl.git pp_iter: move RETPUSHYES outside switch --- diff --git a/pp_hot.c b/pp_hot.c index e63570a..0645524 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1916,7 +1916,9 @@ PP(pp_iter) It has SvPVX of "" and SvCUR of 0, which is what we want. */ STRLEN maxlen = 0; const char *max = SvPV_const(end, maxlen); - if (!SvNIOK(cur) && SvCUR(cur) <= maxlen) { + if (SvNIOK(cur) || SvCUR(cur) > maxlen) + RETPUSHNO; + if (SvREFCNT(*itersvp) == 1 && !SvMAGICAL(*itersvp)) { /* safe to reuse old SV */ sv_setsv(*itersvp, cur); @@ -1934,9 +1936,6 @@ PP(pp_iter) sv_setiv(cur, 0); /* terminate next time */ else sv_inc(cur); - RETPUSHYES; - } - RETPUSHNO; break; } @@ -1965,7 +1964,6 @@ PP(pp_iter) cx->blk_loop.state_u.lazyiv.end = IV_MIN; } else ++cx->blk_loop.state_u.lazyiv.cur; - RETPUSHYES; break; case CXt_LOOP_FOR: @@ -2027,13 +2025,12 @@ PP(pp_iter) oldsv = *itersvp; *itersvp = sv; SvREFCNT_dec(oldsv); - - RETPUSHYES; break; default: DIE(aTHX_ "panic: pp_iter, type=%u", CxTYPE(cx)); } + RETPUSHYES; } /*