New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data::Dumper::Freezer: XS implementation bug #12699
Comments
From @jkeenanCreated by @jkeenanData::Dumper has both XS and pure-Perl implementations and In the case of $Data::Dumper::Freezer = 'foo', or the ########## package Test1; package main; my ($obj, $foo); { local $Data::Dumper::Useperl = 0; { local $Data::Dumper::Useperl = 1; local $Data::Dumper::Useperl = 0; ########## $> perl freezer.pl Freezer method / Perl implementation Freezer method / XS implementation Freezer variable set / Perl implementation Freezer variable set / XS implementation Note that in each case the character '1' is erroneously Thank you very much. Perl Info
|
From @jkeenanAttaching test program. |
From @jkeenan |
From [Unknown Contact. See original ticket]Attaching test program. |
@jkeenan - Status changed from 'new' to 'open' |
From @arcJames E Keenan <perlbug-followup@perl.org> wrote:
The excess 1 is the return value of `freeze`; you can change the 1 to -- |
From @LeontOn Sat, Jan 12, 2013 at 5:01 PM, Aaron Crane <perl@aaroncrane.co.uk> wrote:
Sounds pretty accurate to me: dSP; ENTER; SAVETMPS; PUSHMARK(sp); That second PUTBACK should probably be a POPs. PUTBACK right after an Leon |
From @LeontOn Sat, Jan 12, 2013 at 5:19 PM, Leon Timmermans <fawaka@gmail.com> wrote:
No wait. PUTBACK right after SPAGAIN is useless, but right after POPs Leon |
From mail@steffen-mueller.netOn 01/12/2013 05:21 PM, Leon Timmermans wrote:
So any suggestions for a fix? I'm a bit starved for quality time to --Steffen |
From @arcSteffen Mueller <mail@steffen-mueller.net> wrote:
Does this look sane? I'll apply it if so. Inline Patchdiff --git a/dist/Data-Dumper/Dumper.xs b/dist/Data-Dumper/Dumper.xs
index d7204e1..d0f7145 100644
--- a/dist/Data-Dumper/Dumper.xs
+++ b/dist/Data-Dumper/Dumper.xs
@@ -344,7 +344,7 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN
Inline Patchdiff --git a/dist/Data-Dumper/t/freezer.t b/dist/Data-Dumper/t/freezer.t
index c46d861..a67cc12 100644
--- a/dist/Data-Dumper/t/freezer.t
+++ b/dist/Data-Dumper/t/freezer.t
@@ -25,6 +25,11 @@ ok($dumped_foo,
like($dumped_foo, qr/frozed/,
"Dumped string has the key added by Freezer.");
+# test that list-context freeze return doesn't contain the freezer's return
+# value; RT #116364
+like(join(" ", Dumper($foo)), qr/\A\$VAR1 = /,
+ "Dumped list doesn't begin with Freezer's return value");
+
# run the same tests with useperl. this always worked
{
local $Data::Dumper::Useperl = 1;
@@ -34,6 +39,8 @@ like($dumped_foo, qr/frozed/,
"Use of freezer sub which returns non-ref worked with useperl");
like($dumped_foo, qr/frozed/,
"Dumped string has the key added by Freezer with useperl.");
+ like(join(" ", Dumper($foo)), qr/\A\$VAR1 = /,
+ "Dumped list doesn't begin with Freezer's return value with useperl");
}
# test for warning when an object doesn't have a freeze()
-- Aaron Crane ** http://aaroncrane.co.uk/ |
From @tseeOn 01/13/2013 11:17 AM, Aaron Crane wrote:
It does to me. --Steffen |
From @jkeenanOn 1/13/13 5:17 AM, Aaron Crane wrote:
I tried it out in my github research branch and all tests pass. Please Thank you very much. |
@tonycoz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#116364 (status was 'resolved')
Searchable as RT116364$
The text was updated successfully, but these errors were encountered: