summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-06-11 10:06:02 +0100
committerDavid Mitchell <davem@iabyn.com>2015-06-19 08:44:18 +0100
commit4496054ce9622fa4c6c6b737432d1f1056650d01 (patch)
tree6c56eea1032e0073dbb98a72ec3af186ebb0b2c0
parent1ef2b70a7cb09564d92d47d3d76af07c36455485 (diff)
downloadperl-4496054ce9622fa4c6c6b737432d1f1056650d01.tar.gz
pp_return: set eval CV depth to 0
In pp_leaveval, the CvDEPTH of the eval is set to 0. This doesn't seem to be actually necessary (no tests fail if its removed), but for consistency, add the same step to pp_return, which currently doesn't do this. This is so that shortly we can make pp_return tail call pp_leaveval.
-rw-r--r--pp_ctl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index ec921b86c1..f6f122b827 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2423,6 +2423,7 @@ PP(pp_return)
PMOP *newpm;
I32 optype = 0;
SV *namesv;
+ CV *evalcv;
OP *retop = NULL;
const I32 cxix = dopoptosub(cxstack_ix);
@@ -2491,6 +2492,7 @@ PP(pp_return)
POPEVAL(cx);
namesv = cx->blk_eval.old_namesv;
retop = cx->blk_eval.retop;
+ evalcv = cx->blk_eval.cv;
break;
case CXt_FORMAT:
retop = cx->blk_sub.retop;
@@ -2512,6 +2514,11 @@ PP(pp_return)
PL_stack_sp = newsp;
if (CxTYPE(cx) == CXt_EVAL) {
+#ifdef DEBUGGING
+ assert(CvDEPTH(evalcv) == 1);
+#endif
+ CvDEPTH(evalcv) = 0;
+
if (optype == OP_REQUIRE &&
!(gimme == G_SCALAR ? SvTRUE(*PL_stack_sp) : PL_stack_sp > PL_stack_base + cx->blk_oldsp) )
{