diff options
author | Yves Orton <demerphq@gmail.com> | 2022-02-27 03:20:42 +0100 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-03-02 08:46:28 -0700 |
commit | 277d63d68e5d13aa27dd5eaae7bfb37a7fe84b7a (patch) | |
tree | f8bde03d8a98bce052c235ddbec31567a463e601 /t/run | |
parent | ba2557cc22570b32dcdc36c5ffd056559d5a4110 (diff) | |
download | perl-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 't/run')
-rw-r--r-- | t/run/switchDx.t | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/t/run/switchDx.t b/t/run/switchDx.t index 9ea0a32542..6e132fd632 100644 --- a/t/run/switchDx.t +++ b/t/run/switchDx.t @@ -14,7 +14,7 @@ skip_all "DEBUGGING build required" unless $::Config{ccflags} =~ /(?<!\S)-DDEBUGGING(?!\S)/ or $^O eq 'VMS' && $::Config{usedebugging_perl} eq 'Y'; -plan tests => 8; +plan tests => 9; END { unlink $perlio_log; @@ -47,4 +47,10 @@ END { { stderr => 1, switches => [ '-TDi' ] }, "Perlio debug output to STDERR with -TDi (no PERLIO_DEBUG)"); } - +{ + # -DXv tests + fresh_perl_like('{ my $n=1; *foo= sub () { $n }; }', + qr/To: CV=0x[a-f0-9]+ \(ANON\), OUTSIDE=0x0 \(null\)/, + { stderr => 1, switches => [ '-DXv' ] }, + "-DXv does not assert when dumping anonymous constant sub"); +} |