summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-10-08 22:50:51 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-10-08 22:50:51 +0000
commita8bba7fac320f0a7f553e9a133cddd65ef2a66c7 (patch)
tree01976e0bfb697adf8261ba355cfc04fed614fb96 /pp_hot.c
parent98eae8f585b9800849b5e5482e2d405f21bab67e (diff)
downloadperl-a8bba7fac320f0a7f553e9a133cddd65ef2a66c7.tar.gz
revert POP{SUB,LOOP}{1,2} logic to the simpler pre-5.003_24
situation (assumptions about cx invalidation are not valid anymore) p4raw-id: //depot/perl@4320
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 8e795cb637..90e8f5f4ba 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1914,16 +1914,14 @@ PP(pp_leavesub)
PMOP *newpm;
I32 gimme;
register PERL_CONTEXT *cx;
- struct block_sub cxsub;
POPBLOCK(cx,newpm);
- POPSUB1(cx); /* Delay POPSUB2 until stack values are safe */
TAINT_NOT;
if (gimme == G_SCALAR) {
MARK = newsp + 1;
if (MARK <= SP) {
- if (cxsub.cv && CvDEPTH(cxsub.cv) > 1) {
+ if (cx->blk_sub.cv && CvDEPTH(cx->blk_sub.cv) > 1) {
if (SvTEMP(TOPs)) {
*MARK = SvREFCNT_inc(TOPs);
FREETMPS;
@@ -1953,7 +1951,7 @@ PP(pp_leavesub)
}
PUTBACK;
- POPSUB2(); /* Stack values are safe: release CV and @_ ... */
+ POPSUB(cx); /* Stack values are safe: release CV and @_ ... */
PL_curpm = newpm; /* ... and pop $1 et al */
LEAVE;
@@ -1970,10 +1968,8 @@ PP(pp_leavesublv)
PMOP *newpm;
I32 gimme;
register PERL_CONTEXT *cx;
- struct block_sub cxsub;
POPBLOCK(cx,newpm);
- POPSUB1(cx); /* Delay POPSUB2 until stack values are safe */
TAINT_NOT;
@@ -1988,7 +1984,7 @@ PP(pp_leavesublv)
if (gimme == G_SCALAR)
goto temporise;
if (gimme == G_ARRAY) {
- if (!CvLVALUE(cxsub.cv))
+ if (!CvLVALUE(cx->blk_sub.cv))
goto temporise_array;
EXTEND_MORTAL(SP - newsp);
for (mark = newsp + 1; mark <= SP; mark++) {
@@ -2008,8 +2004,8 @@ PP(pp_leavesublv)
/* Here we go for robustness, not for speed, so we change all
* the refcounts so the caller gets a live guy. Cannot set
* TEMP, so sv_2mortal is out of question. */
- if (!CvLVALUE(cxsub.cv)) {
- POPSUB2();
+ if (!CvLVALUE(cx->blk_sub.cv)) {
+ POPSUB(cx);
PL_curpm = newpm;
DIE(aTHX_ "Can't modify non-lvalue subroutine call");
}
@@ -2018,7 +2014,7 @@ PP(pp_leavesublv)
EXTEND_MORTAL(1);
if (MARK == SP) {
if (SvFLAGS(TOPs) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY)) {
- POPSUB2();
+ POPSUB(cx);
PL_curpm = newpm;
DIE(aTHX_ "Can't return a %s from lvalue subroutine",
SvREADONLY(TOPs) ? "readonly value" : "temporary");
@@ -2030,7 +2026,7 @@ PP(pp_leavesublv)
}
}
else { /* Should not happen? */
- POPSUB2();
+ POPSUB(cx);
PL_curpm = newpm;
DIE(aTHX_ "%s returned from lvalue subroutine in scalar context",
(MARK > SP ? "Empty array" : "Array"));
@@ -2043,7 +2039,7 @@ PP(pp_leavesublv)
if (SvFLAGS(*mark) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY)) {
/* Might be flattened array after $#array = */
PUTBACK;
- POPSUB2();
+ POPSUB(cx);
PL_curpm = newpm;
DIE(aTHX_ "Can't return %s from lvalue subroutine",
(*mark != &PL_sv_undef)
@@ -2065,7 +2061,7 @@ PP(pp_leavesublv)
temporise:
MARK = newsp + 1;
if (MARK <= SP) {
- if (cxsub.cv && CvDEPTH(cxsub.cv) > 1) {
+ if (cx->blk_sub.cv && CvDEPTH(cx->blk_sub.cv) > 1) {
if (SvTEMP(TOPs)) {
*MARK = SvREFCNT_inc(TOPs);
FREETMPS;
@@ -2097,7 +2093,7 @@ PP(pp_leavesublv)
}
PUTBACK;
- POPSUB2(); /* Stack values are safe: release CV and @_ ... */
+ POPSUB(cx); /* Stack values are safe: release CV and @_ ... */
PL_curpm = newpm; /* ... and pop $1 et al */
LEAVE;