In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/0540b90bcca7b8f2c1eb9ab87c5fea1b461df4cf?hp=c1e747343c6fcec3475fcb1ebbecc1118235202d>
- Log ----------------------------------------------------------------- commit 0540b90bcca7b8f2c1eb9ab87c5fea1b461df4cf Author: Karl Williamson <[email protected]> Date: Fri Jan 20 14:55:43 2012 -0700 Safe.pm: Make sure SWASHNEW is properly loaded This module was depending on testing code points in the upper Latin1 range causing utf8_heavy.pl. However a recent performance improvement caused those code points to skip the loading. This just changes the code points to two higher values that cause it to load, and until and if it changes again, will fix things. ----------------------------------------------------------------------- Summary of changes: dist/Safe/Changes | 3 +++ dist/Safe/Safe.pm | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/dist/Safe/Changes b/dist/Safe/Changes index 54f9dc6..593049c 100644 --- a/dist/Safe/Changes +++ b/dist/Safe/Changes @@ -1,3 +1,6 @@ +2.31 Fri Jan 20 2012 + - Now need to use code points above 255 to get SWASHNEW to load + 2.30 Tue Dec 6 2011 - Fix bad interaction with loading Tie::Hash::NamedCapture on perls >= 5.14.0 [rt.cpan.org #72872] diff --git a/dist/Safe/Safe.pm b/dist/Safe/Safe.pm index 8d0e4fd..9335dc6 100644 --- a/dist/Safe/Safe.pm +++ b/dist/Safe/Safe.pm @@ -4,7 +4,7 @@ use 5.003_11; use strict; use Scalar::Util qw(reftype refaddr); -$Safe::VERSION = "2.30"; +$Safe::VERSION = "2.31"; # *** Don't declare any lexicals above this point *** # @@ -61,12 +61,13 @@ use Opcode 1.01, qw( # Safe is loaded. Then we can add utf8::SWASHNEW to $default_share. require utf8; # we must ensure that utf8_heavy.pl, where SWASHNEW is defined, is loaded -# but without depending on knowledge of that implementation detail. -# This code (//i on a unicode string) ensures utf8 is fully loaded -# and also loads the ToFold SWASH. +# but without depending on too much knowledge of that implementation detail. +# This code (//i on a unicode string) should ensure utf8 is fully loaded +# and also loads the ToFold SWASH, unless things change so that these +# particular code points don't cause it to load. # (Swashes are cached internally by perl in PL_utf8_* variables # independent of being inside/outside of Safe. So once loaded they can be) -do { my $a = pack('U',0xC4); my $b = chr 0xE4; utf8::upgrade $b; $a =~ /$b/i }; +do { my $a = pack('U',0x100); my $b = chr 0x101; utf8::upgrade $b; $a =~ /$b/i }; # now we can safely include utf8::SWASHNEW in $default_share defined below. my $default_root = 0; -- Perl5 Master Repository
