summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-04-24 08:43:24 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-04-24 08:43:24 +0000
commit855383171f82b0033b4163a01d30ba375967a9d0 (patch)
treea22da01cd6f1a18ac0b25aef643b0b5f678f618a /op.c
parent32b22042d2a54453bc0d4b6b7f1d2123903a49be (diff)
downloadperl-855383171f82b0033b4163a01d30ba375967a9d0.tar.gz
arrange for next() to resume at the unstack op rather than the
loop conditional, so that scope cleanup happens correctly (from Stephen McCamant) p4raw-id: //depot/perl@5927
Diffstat (limited to 'op.c')
-rw-r--r--op.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/op.c b/op.c
index 1cfc6dde2a..64b80062b7 100644
--- a/op.c
+++ b/op.c
@@ -3848,7 +3848,10 @@ Perl_newWHILEOP(pTHX_ I32 flags, I32 debuggable, LOOP *loop, I32 whileline, OP *
loopflags |= OPpLOOP_CONTINUE;
}
if (expr) {
- cont = append_elem(OP_LINESEQ, cont, newOP(OP_UNSTACK, 0));
+ OP *unstack = newOP(OP_UNSTACK, 0);
+ if (!next)
+ next = unstack;
+ cont = append_elem(OP_LINESEQ, cont, unstack);
if ((line_t)whileline != NOLINE) {
PL_copline = whileline;
cont = append_elem(OP_LINESEQ, cont,
@@ -3871,8 +3874,6 @@ Perl_newWHILEOP(pTHX_ I32 flags, I32 debuggable, LOOP *loop, I32 whileline, OP *
if (listop)
((LISTOP*)listop)->op_last->op_next = condop =
(o == listop ? redo : LINKLIST(o));
- if (!next)
- next = condop;
}
else
o = listop;