summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2005-05-04 14:01:40 +0000
committerDave Mitchell <davem@fdisolutions.com>2005-05-04 14:01:40 +0000
commit3a1b2b9e42aa284970a0868f88d8857a18a0a3b9 (patch)
treeae1e14bb75b2223e5071c231a860306c969335c0 /pp_ctl.c
parent304dea91bf747b5b240c3ec3a6a4dfebeab12289 (diff)
downloadperl-3a1b2b9e42aa284970a0868f88d8857a18a0a3b9.tar.gz
[perl #35214] SEGV when next is followed by a goto
next and redo didn't restore PL_curcop p4raw-id: //depot/perl@24384
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index c4aa30ed72..03a4171e51 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1890,6 +1890,7 @@ PP(pp_leaveloop)
SV **mark;
POPBLOCK(cx,newpm);
+ assert(CxTYPE(cx) == CXt_LOOP);
mark = newsp;
newsp = PL_stack_base + cx->blk_loop.resetsp;
@@ -2149,6 +2150,7 @@ PP(pp_next)
TOPBLOCK(cx);
if (PL_scopestack_ix < inner)
leave_scope(PL_scopestack[PL_scopestack_ix]);
+ PL_curcop = cx->blk_oldcop;
return cx->blk_loop.next_op;
}
@@ -2176,6 +2178,7 @@ PP(pp_redo)
oldsave = PL_scopestack[PL_scopestack_ix - 1];
LEAVE_SCOPE(oldsave);
FREETMPS;
+ PL_curcop = cx->blk_oldcop;
return cx->blk_loop.redo_op;
}