In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/50621bf1d40510490a77db174fbc16c1fbfb8aea?hp=e9b90335606dcae569679dd71fa9a380955fb8f7>
- Log ----------------------------------------------------------------- commit 50621bf1d40510490a77db174fbc16c1fbfb8aea Author: Zefram <[email protected]> Date: Fri Jul 21 08:50:12 2017 +0100 fix Storable test for pre-5.19.2 threaded perls The test of Storable's identity-preserving handling of the immortal scalars ran into trouble with an old bug regarding overloading of the PADTMP flag, which could prevent the test script getting actual references to the immortal truth values in order to feed to Storable and to compare its output against. On the affected perls, compiling code that includes a const op whose value is an immortal makes subsequent executions of the refgen operator on that immortal scalar copy it, breaking its identity. Loading the testing infrastructure modules could easily perform such compilation, though whether it actually does depends on the versions of the modules. Work around this by taking the platinum-iridium immortal references first thing in the test script, before loading anything that could break it. M dist/Storable/t/blessed.t commit 40c7720facf5e6944805c593ad6a5604ad88c9ce Author: Zefram <[email protected]> Date: Fri Jul 21 05:48:20 2017 +0100 restore Storable's portability to pre-5.25.6 perls Commit 4f72e1e921be7caffd7029f421f171bad7f485f2 changed Storable.xs to use SvPVCLEAR(), defined only on 5.25.6 and later, but didn't supply a reserve definition. Add the obvious reserve definition. M dist/Storable/Storable.pm M dist/Storable/Storable.xs ----------------------------------------------------------------------- Summary of changes: dist/Storable/Storable.pm | 2 +- dist/Storable/Storable.xs | 4 ++++ dist/Storable/t/blessed.t | 19 +++++++++++++------ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/dist/Storable/Storable.pm b/dist/Storable/Storable.pm index 3adc8044de..ae96a6c7ed 100644 --- a/dist/Storable/Storable.pm +++ b/dist/Storable/Storable.pm @@ -22,7 +22,7 @@ package Storable; @ISA = qw(Exporter); use vars qw($canonical $forgive_me $VERSION); -$VERSION = '2.63'; +$VERSION = '2.64'; BEGIN { if (eval { diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs index 1043bf7914..dcd24e7bdc 100644 --- a/dist/Storable/Storable.xs +++ b/dist/Storable/Storable.xs @@ -87,6 +87,10 @@ # define SvTRULYREADONLY(sv) (SvREADONLY(sv) && !SvIsCOW(sv)) #endif +#ifndef SvPVCLEAR +# define SvPVCLEAR(sv) sv_setpvs((sv), "") +#endif + #ifdef DEBUGME #ifndef DASSERT diff --git a/dist/Storable/t/blessed.t b/dist/Storable/t/blessed.t index fe439acea8..352eb5f7e9 100644 --- a/dist/Storable/t/blessed.t +++ b/dist/Storable/t/blessed.t @@ -6,6 +6,19 @@ # in the README file that comes with the distribution. # +BEGIN { + # Do this as the very first thing, in order to avoid problems with the + # PADTMP flag on pre-5.19.3 threaded Perls. On those Perls, compiling + # code that contains a constant-folded canonical truth value breaks + # the ability to take a reference to that canonical truth value later. + $::false = 0; + %::immortals = ( + 'u' => \undef, + 'y' => \!$::false, + 'n' => \!!$::false, + ); +} + sub BEGIN { unshift @INC, 't'; unshift @INC, 't/compat' if $] < 5.006002; @@ -20,12 +33,6 @@ use Test::More; use Storable qw(freeze thaw store retrieve); -%::immortals - = (u => \undef, - 'y' => \(1 == 1), - n => \(1 == 0) -); - { %::weird_refs = ( REF => \(my $aref = []), -- Perl5 Master Repository
