From 8235b1c2e77c454865e73bc098b667c3d9aa58a7 Mon Sep 17 00:00:00 2001 From: Aaron Crane Date: Wed, 4 Jan 2017 15:42:32 +0000 Subject: [PATCH] RT#130487: fix stack-management bug in Data::Dumper This was introduced when Data::Dumper acquired the ability to call B::Deparse from its XS implementation. --- dist/Data-Dumper/Dumper.pm | 6 +++--- dist/Data-Dumper/Dumper.xs | 2 ++ dist/Data-Dumper/t/bugs.t | 13 ++++++++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/dist/Data-Dumper/Dumper.pm b/dist/Data-Dumper/Dumper.pm index 78efd44cae6c..00f6326ee134 100644 --- a/dist/Data-Dumper/Dumper.pm +++ b/dist/Data-Dumper/Dumper.pm @@ -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; @@ -1459,13 +1459,13 @@ be to use the C 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 diff --git a/dist/Data-Dumper/Dumper.xs b/dist/Data-Dumper/Dumper.xs index d288bbd8d52c..0e7142e22227 100644 --- a/dist/Data-Dumper/Dumper.xs +++ b/dist/Data-Dumper/Dumper.xs @@ -548,6 +548,8 @@ deparsed_output(pTHX_ SV *val) FREETMPS; + PUTBACK; + return text; } diff --git a/dist/Data-Dumper/t/bugs.t b/dist/Data-Dumper/t/bugs.t index 0a1ee8f7d1fe..5db82dad328c 100644 --- a/dist/Data-Dumper/t/bugs.t +++ b/dist/Data-Dumper/t/bugs.t @@ -12,7 +12,7 @@ BEGIN { } use strict; -use Test::More tests => 23; +use Test::More tests => 24; use Data::Dumper; { @@ -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