summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-11-15 15:53:13 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-11-15 16:10:53 -0800
commit9d976ff5cc49c35e6ef2717c206d6a4db4793dec (patch)
tree8fc2d077af4fb74cbd9575dbea42399d79434183 /pp_ctl.c
parent576fa0247cb77313053597d85f630b37a7fa7d3e (diff)
downloadperl-9d976ff5cc49c35e6ef2717c206d6a4db4793dec.tar.gz
[perl #115742] Push a new pad for recursive DB::DB
When invoking the debugger recursively, pp_dbstate needs to push a new pad (like pp_entersub) so that DB::DB doesn’t stomp on the lexical variables belonging to the outer call.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 5374e0f440..24eac160e1 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2000,8 +2000,12 @@ PP(pp_dbstate)
PUSHSUB_DB(cx);
cx->blk_sub.retop = PL_op->op_next;
CvDEPTH(cv)++;
+ if (CvDEPTH(cv) >= 2) {
+ PERL_STACK_OVERFLOW_CHECK();
+ pad_push(CvPADLIST(cv), CvDEPTH(cv));
+ }
SAVECOMPPAD();
- PAD_SET_CUR_NOSAVE(CvPADLIST(cv), 1);
+ PAD_SET_CUR_NOSAVE(CvPADLIST(cv), CvDEPTH(cv));
RETURNOP(CvSTART(cv));
}
}