Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 7407a67

Browse files
author
Reini Urban
committed
perl5db: hack pad corruption with siggoto (WIP)
The debugger is next to unusable with tailcalls, i.e. goto signatures, i.e. all tests. With DEBUGGING it will assert on off-by-one CvDEPTH's (one too many), without it will not step, no converted dbstate ops. repro: ./perl -Ilib -d ext/POSIX/t/posix.t
1 parent cf537db commit 7407a67

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

inline.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,20 @@ S_cx_popsub_args(pTHX_ PERL_CONTEXT *cx)
550550

551551
PERL_ARGS_ASSERT_CX_POPSUB_ARGS;
552552
assert(CxTYPE(cx) == CXt_SUB);
553+
#ifdef DEBUGGING
553554
assert(AvARRAY(MUTABLE_AV(
554555
PadlistARRAY(CvPADLIST(cx->blk_sub.cv))[
555-
CvDEPTH(cx->blk_sub.cv)])) == PL_curpad);
556+
CvDEPTH(cx->blk_sub.cv)])) == PL_curpad
557+
/* only under -d */
558+
|| AvARRAY(MUTABLE_AV(
559+
PadlistARRAY(CvPADLIST(cx->blk_sub.cv))[
560+
CvDEPTH(cx->blk_sub.cv)-1])) == PL_curpad);
561+
/* hack pad corruption with -d */
562+
if (PL_DBsub && GvCV(PL_DBsub) && AvARRAY(MUTABLE_AV(
563+
PadlistARRAY(CvPADLIST(cx->blk_sub.cv))[
564+
CvDEPTH(cx->blk_sub.cv)-1])) == PL_curpad)
565+
CvDEPTH(cx->blk_sub.cv)--;
566+
#endif
556567

557568
CX_POP_SAVEARRAY(cx);
558569
av = MUTABLE_AV(PAD_SVl(0));

0 commit comments

Comments
 (0)