summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2003-08-24 16:52:00 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-08-26 19:13:39 +0000
commit5dd42e15760f2e77ab3979bfe1b6aafaa9ff1227 (patch)
tree0afca94ca8522b7c1ac1afeea67258cd0ce57290 /pp_ctl.c
parentd7f1a795527ad4875d71a2e977851f754d4b7b3f (diff)
downloadperl-5dd42e15760f2e77ab3979bfe1b6aafaa9ff1227.tar.gz
improved 19064 (local $_[0] problems)
Message-ID: <20030824145159.GA12210@fdgroup.com> p4raw-id: //depot/perl@20909
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 3c08f22e68..1fd6e01d38 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1883,6 +1883,7 @@ PP(pp_return)
switch (CxTYPE(cx)) {
case CXt_SUB:
popsub2 = TRUE;
+ cxstack_ix++; /* preserve cx entry on stack for use by POPSUB */
break;
case CXt_EVAL:
if (!(PL_in_eval & EVAL_KEEPERR))
@@ -1942,15 +1943,16 @@ PP(pp_return)
}
PL_stack_sp = newsp;
+ LEAVE;
/* Stack values are safe: */
if (popsub2) {
+ cxstack_ix--;
POPSUB(cx,sv); /* release CV and @_ ... */
}
else
sv = Nullsv;
PL_curpm = newpm; /* ... and pop $1 et al */
- LEAVE;
LEAVESUB(sv);
if (clear_errsv)
sv_setpv(ERRSV,"");
@@ -1985,6 +1987,7 @@ PP(pp_last)
dounwind(cxix);
POPBLOCK(cx,newpm);
+ cxstack_ix++; /* temporarily protect top context */
mark = newsp;
switch (CxTYPE(cx)) {
case CXt_LOOP:
@@ -2026,6 +2029,8 @@ PP(pp_last)
SP = newsp;
PUTBACK;
+ LEAVE;
+ cxstack_ix--;
/* Stack values are safe: */
switch (pop2) {
case CXt_LOOP:
@@ -2038,7 +2043,6 @@ PP(pp_last)
}
PL_curpm = newpm; /* ... and pop $1 et al */
- LEAVE;
LEAVESUB(sv);
return nextop;
}