summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2022-02-27 03:20:42 +0100
committerKarl Williamson <khw@cpan.org>2022-03-02 08:46:28 -0700
commit277d63d68e5d13aa27dd5eaae7bfb37a7fe84b7a (patch)
treef8bde03d8a98bce052c235ddbec31567a463e601 /pad.c
parentba2557cc22570b32dcdc36c5ffd056559d5a4110 (diff)
downloadperl-277d63d68e5d13aa27dd5eaae7bfb37a7fe84b7a.tar.gz
pad.c: Fix GH Issue #19463, -DXv fails assert when dumping anonymous constant sub
Anonymous constant subs were changed to be implemented internally as XSUBs in 5.21.6, commit 1567c65ac069266bfe65959430c185babd476538. This broke DEBUGGING perls running under -DXv which weren't taught about the new implementation. In ed958fa3156084f3cf4d8c4768716d9e1a11ce91 strict.pm also was changed to use such subs, which then breaks many uses of -DXv. See t/run/switchDx.t for an example of code that would trigger this that does not depend on strict.pm This fixes the problem and adds a test for -Dx.
Diffstat (limited to 'pad.c')
-rw-r--r--pad.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/pad.c b/pad.c
index bc41a475bb..edfb836123 100644
--- a/pad.c
+++ b/pad.c
@@ -1858,7 +1858,6 @@ STATIC void
S_cv_dump(pTHX_ const CV *cv, const char *title)
{
const CV * const outside = CvOUTSIDE(cv);
- PADLIST* const padlist = CvPADLIST(cv);
PERL_ARGS_ASSERT_CV_DUMP;
@@ -1878,9 +1877,15 @@ S_cv_dump(pTHX_ const CV *cv, const char *title)
: CvUNIQUE(outside) ? "UNIQUE"
: CvGV(outside) ? GvNAME(CvGV(outside)) : "UNDEFINED"));
- PerlIO_printf(Perl_debug_log,
+ if (!CvISXSUB(cv)) {
+ /* SVPADLIST(cv) will fail an assert if CvISXSUB(cv) is true,
+ * and if the assert is removed this code will SEGV. XSUBs don't
+ * have padlists I believe - Yves */
+ PADLIST* const padlist = CvPADLIST(cv);
+ PerlIO_printf(Perl_debug_log,
" PADLIST = 0x%" UVxf "\n", PTR2UV(padlist));
- do_dump_pad(1, Perl_debug_log, padlist, 1);
+ do_dump_pad(1, Perl_debug_log, padlist, 1);
+ }
}
#endif /* DEBUGGING */