In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/f374360c52233c7d72ba874294a00ee18d910d08?hp=b14845b4fc65ba895fe9fe5f9cc346c5c235c28b>

- Log -----------------------------------------------------------------
commit f374360c52233c7d72ba874294a00ee18d910d08
Author: Father Chrysostomos <[email protected]>
Date:   Fri Apr 20 22:50:11 2012 -0700

    [perl #112316] Make strict vars respect null-to-null assignment
    
    This is a follow-up to commits 6379d4a9a and 862504fb08.
    
    As Karl Williamson (thank you!) pointed out, my changes were not suf-
    ficient, because strEQ was still being used, which stops at the first
    null, treating "foo\0bar" and "foo\0foo" as equivalent.
    
    Under threads, strict vars was not respecting glob assignment from a
    package with a null in its name to another also with a null in its
    name, if the two package names shared a common prefix up to the null.
-----------------------------------------------------------------------

Summary of changes:
 t/lib/strict/vars |   10 ++++++++++
 util.c            |    2 +-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/t/lib/strict/vars b/t/lib/strict/vars
index b8c6d1f..87e5a77 100644
--- a/t/lib/strict/vars
+++ b/t/lib/strict/vars
@@ -555,6 +555,16 @@ use strict;
 eval 'package foo; @bar = 1' or die;
 EXPECT
 ########
+# [perl #112316] strict vars getting confused by nulls
+# Assigning from one null package to another, with a common prefix
+BEGIN { *Foo:: = *{"foo\0foo::"};
+        *Bar:: = *{"foo\0bar::"} }
+package Foo;
+*Bar::bar = [];
+use strict;
+eval 'package Bar; @bar = 1' or die;
+EXPECT
+########
 # UTF8 and Latin1 package names equivalent at the byte level
 use utf8;
 # ĵ in UTF-8 is the same as ĵ in Latin-1
diff --git a/util.c b/util.c
index 716944d..171456f 100644
--- a/util.c
+++ b/util.c
@@ -5875,7 +5875,7 @@ Perl_stashpv_hvname_match(pTHX_ const COP *c, const HV 
*hv)
     else
         return (stashpv == name
                     || (HEK_LEN(HvNAME_HEK(hv)) == len
-                        && strEQ(stashpv, name)));
+                        && memEQ(stashpv, name, len)));
     /*NOTREACHED*/
     return FALSE;
 }

--
Perl5 Master Repository

Reply via email to