summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2012-11-13 11:15:01 +0000
committerDavid Mitchell <davem@iabyn.com>2012-11-15 22:41:07 +0000
commit7d6c2cef76517581274f186d3ceb1c30fda45208 (patch)
tree9096bd303b47de5f261b14c8eee7e99c5a26a996 /pp_hot.c
parent25e3aa3332bf90bf0b2b8dd3e9a7762d9da4fe8f (diff)
downloadperl-7d6c2cef76517581274f186d3ceb1c30fda45208.tar.gz
pp_iter: move var declarations to narrower scope
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 719fef233b..e02558c3ef 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1897,10 +1897,8 @@ PP(pp_iter)
{
dVAR; dSP;
PERL_CONTEXT *cx;
- SV *sv, *oldsv;
+ SV *oldsv;
SV **itersvp;
- AV *av = NULL; /* used for LOOP_FOR on arrays and the stack */
- bool av_is_stack = FALSE;
EXTEND(SP, 1);
cx = &cxstack[cxstack_ix];
@@ -1967,9 +1965,13 @@ PP(pp_iter)
break;
case CXt_LOOP_FOR:
+ {
/* iterate array */
- av = cx->blk_loop.state_u.ary.ary;
+ AV *av = cx->blk_loop.state_u.ary.ary;
+ SV *sv;
+ bool av_is_stack = FALSE;
+
if (!av) {
av_is_stack = TRUE;
av = PL_curstack;
@@ -2026,6 +2028,7 @@ PP(pp_iter)
*itersvp = sv;
SvREFCNT_dec(oldsv);
break;
+ }
default:
DIE(aTHX_ "panic: pp_iter, type=%u", CxTYPE(cx));