diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-23 06:43:51 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-23 06:43:51 +0000 |
commit | 1ee987245c095afd177d3e2ca6255cec8dbb53ca (patch) | |
tree | 6a572e192f37b2730dffe54c5fdd55ca80629a08 /pp_ctl.c | |
parent | 43d4d5c68e72a81744de7e89e6fd076b16f00314 (diff) | |
download | perl-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.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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) |