Skip Menu |

This queue is for tickets about the Devel-MAT CPAN distribution.

Report information
The Basics
Id: 112227
Status: resolved
Priority: 0/
Queue: Devel-MAT

People
Owner: Nobody in particular
Requestors: KENTNL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.21
Fixed in: 0.22



Subject: Compile fails after perl 5.23.8/9513529

argarray vanishes after this commit, causing compile failure:

 

http://perl5.git.perl.org/perl.git/commitdiff/9513529

 

Building Devel-MAT
cc -I/home/kent/perl5/perlbrew/perls/5.23.8-nossp-sdbm-nopmc/lib/5.23.8/x86_64-linux/CORE -DVERSION="0.21" -DXS_VERSION="0.21" -fPIC -c -fno-stack-protector -DPERL_HASH_FUNC_SDBM -DPERL_DISABLE_PMC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-stack-protector -O3 -march=native -mtune=native -o lib/Devel/MAT/Dumper.o lib/Devel/MAT/Dumper.c
lib/Devel/MAT/Dumper.xs: In function ‘dumpfh’:
lib/Devel/MAT/Dumper.xs:942:57: error: ‘const struct block_sub’ has no member named ‘argarray’
         write_svptr(fh, CxHASARGS(cx) ? (SV*)cx->blk_sub.argarray : NULL);
                                                         ^
error building lib/Devel/MAT/Dumper.o from 'lib/Devel/MAT/Dumper.c' at /home/kent/perl5/perlbrew/perls/5.23.8-nossp-sdbm-nopmc/lib/5.23.8/ExtUtils/CBuilder/Base.pm line 174.
 

Seems not too difficult to workaround. Write it out as NULL in the dumpfile (to preserve the format), and then reconstruct it from the CV and depth at access time. Patch attached. -- Paul Evans
Subject: rt112227.patch
=== modified file 'lib/Devel/MAT/Context.pm' --- lib/Devel/MAT/Context.pm 2016-03-09 14:18:02 +0000 +++ lib/Devel/MAT/Context.pm 2016-03-16 15:24:55 +0000 @@ -1,7 +1,7 @@ # You may distribute under the terms of either the GNU General Public License # or the Artistic License (the same terms as Perl itself) # -# (C) Paul Evans, 2013 -- leonerd@leonerd.org.uk +# (C) Paul Evans, 2013-2016 -- leonerd@leonerd.org.uk package Devel::MAT::Context; @@ -127,6 +127,8 @@ ( $self->{olddepth} ) = unpack "$df->{u32_fmt}", $bytes; ( $self->{cv_at}, $self->{args_at} ) = @$ptrs; + + undef $self->{args_at} if $df->perlversion ge "5.23.8"; } sub _load_v0_1 @@ -138,6 +140,8 @@ $self->{cv_at} = $df->_read_ptr; $self->{args_at} = $df->_read_ptr; + + undef $self->{args_at} if $df->perlversion ge "5.23.8"; } =head2 $cv = $ctx->cv @@ -162,7 +166,19 @@ =cut sub cv { my $self = shift; return $self->{df}->sv_at( $self->{cv_at} ) } -sub args { my $self = shift; return $self->{df}->sv_at( $self->{args_at} ) } + +sub args +{ + my $self = shift; + # Perl 5.23.8 removed blk_sub.argarray so we have to go the long way round + $self->{args_at} //= do { + my $cv = $self->cv; + my $args = $cv->pad( $self->depth )->elem( 0 ); + $args->addr; + }; + + return $self->{df}->sv_at( $self->{args_at} ); +} sub olddepth { return $_[0]->{olddepth} } === modified file 'lib/Devel/MAT/Dumper.xs' --- lib/Devel/MAT/Dumper.xs 2015-10-29 20:55:45 +0000 +++ lib/Devel/MAT/Dumper.xs 2016-03-16 15:24:55 +0000 @@ -1,7 +1,7 @@ /* You may distribute under the terms of either the GNU General Public License * or the Artistic License (the same terms as Perl itself) * - * (C) Paul Evans, 2013-2014 -- leonerd@leonerd.org.uk + * (C) Paul Evans, 2013-2016 -- leonerd@leonerd.org.uk */ #include "EXTERN.h" @@ -939,7 +939,11 @@ write_u32(fh, cx->blk_sub.olddepth); write_svptr(fh, (SV*)cx->blk_sub.cv); +#if (PERL_REVISION == 5) && ((PERL_VERSION > 23) || (PERL_VERSION == 23 && PERL_SUBVERSION >= 8)) + write_svptr(fh, NULL); +#else write_svptr(fh, CxHASARGS(cx) ? (SV*)cx->blk_sub.argarray : NULL); +#endif break; }
Released in 0.22 -- Paul Evans