Skip to content

Commit

Permalink
RT#130487: fix stack-management bug in Data::Dumper
Browse files Browse the repository at this point in the history
This was introduced when Data::Dumper acquired the ability to call
B::Deparse from its XS implementation.
  • Loading branch information
arc committed Jan 4, 2017
1 parent 8faf4f3 commit 8235b1c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dist/Data-Dumper/Dumper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
package Data::Dumper;

BEGIN {
$VERSION = '2.166'; # Don't forget to set version and release
$VERSION = '2.167'; # Don't forget to set version and release
} # date in POD below!

#$| = 1;
Expand Down Expand Up @@ -1459,13 +1459,13 @@ be to use the C<Sortkeys> filter of Data::Dumper.
Gurusamy Sarathy gsar@activestate.com
Copyright (c) 1996-2016 Gurusamy Sarathy. All rights reserved.
Copyright (c) 1996-2017 Gurusamy Sarathy. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
=head1 VERSION
Version 2.166 (November 14 2016)
Version 2.167 (January 4 2017)
=head1 SEE ALSO
Expand Down
2 changes: 2 additions & 0 deletions dist/Data-Dumper/Dumper.xs
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,8 @@ deparsed_output(pTHX_ SV *val)

FREETMPS;

PUTBACK;

return text;
}

Expand Down
13 changes: 12 additions & 1 deletion dist/Data-Dumper/t/bugs.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BEGIN {
}

use strict;
use Test::More tests => 23;
use Test::More tests => 24;
use Data::Dumper;

{
Expand Down Expand Up @@ -168,4 +168,15 @@ SKIP: {
}
}

# RT#130487 - stack management bug in XS deparse
SKIP: {
skip "No XS available", 1 if !defined &Data::Dumper::Dumpxs;
sub rt130487_args { 0 + @_ }
my $code = sub {};
local $Data::Dumper::Useperl = 0;
local $Data::Dumper::Deparse = 1;
my $got = rt130487_args( Dumper($code) );
is($got, 1, "stack management in XS deparse works, rt 130487");
}

# EOF

0 comments on commit 8235b1c

Please sign in to comment.