summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-01-23 06:43:51 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-01-23 06:43:51 +0000
commit1ee987245c095afd177d3e2ca6255cec8dbb53ca (patch)
tree6a572e192f37b2730dffe54c5fdd55ca80629a08 /pp_ctl.c
parent43d4d5c68e72a81744de7e89e6fd076b16f00314 (diff)
downloadperl-1ee987245c095afd177d3e2ca6255cec8dbb53ca.tar.gz
fix scope cleanup when next jumps to a continue block; this is rather
in the nature of a kludge; it doesn't fix the longstanding bug that makes C<while (!$x++) { local $x = 7 } continue { print $x }> print "7" instead of "1") p4raw-id: //depot/perl@4848
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index af8b947794..af31a1c134 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1960,9 +1960,15 @@ PP(pp_next)
dounwind(cxix);
TOPBLOCK(cx);
- oldsave = PL_scopestack[PL_scopestack_ix - 1];
- LEAVE_SCOPE(oldsave);
- return cx->blk_loop.next_op;
+ {
+ OP *nextop = cx->blk_loop.next_op;
+ /* clean scope, but only if there's no continue block */
+ if (nextop == cUNOPx(cx->blk_loop.last_op)->op_first->op_next) {
+ oldsave = PL_scopestack[PL_scopestack_ix - 1];
+ LEAVE_SCOPE(oldsave);
+ }
+ return nextop;
+ }
}
PP(pp_redo)