In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/f6807ef7d323c1a8bd2c4e2bb6a34c434ab13eca?hp=82947af8f50ec744d93ebd93fecddb9fa6e97e4c>

- Log -----------------------------------------------------------------
commit f6807ef7d323c1a8bd2c4e2bb6a34c434ab13eca
Author: Father Chrysostomos <[email protected]>
Date:   Fri Sep 5 13:53:56 2014 -0700

    lex_utf8.t can run under miniperl
    
    but needs the Unicode tables built

M       t/uni/lex_utf8.t

commit 42d532a64cfb4c36e68f8ff06cb4ca1c76299463
Author: Father Chrysostomos <[email protected]>
Date:   Fri Sep 5 13:53:00 2014 -0700

    Fix my constant $var utf8 confusion
    
    ‘my some_constant $var’ tries to resolve some_constant to a package
    name and then look that up, but, when using the value of the constant
    to do a stash lookup, it was applying the utf8 flag if ‘use utf8’ was
    in scope, even if the constant wasn’t utf8:
    
    $ ./perl -Ilib -e 'use constant foo=>qq|\xc4\xb5|; 
BEGIN{${"\xc4\xb5::foo"}}; my foo $dog; print "ok\n"'
    ok
    $ ./perl -Ilib -e 'use constant foo=>qq|\xc4\xb5|; 
BEGIN{${"\xc4\xb5::foo"}}; use utf8; my foo $dog; print "ok\n"'
    No such class foo at -e line 1, near "; my foo"
    Execution of -e aborted due to compilation errors.

M       t/uni/lex_utf8.t
M       toke.c
-----------------------------------------------------------------------

Summary of changes:
 t/uni/lex_utf8.t | 9 +++++++--
 toke.c           | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/t/uni/lex_utf8.t b/t/uni/lex_utf8.t
index d6c6261..5391e3c 100644
--- a/t/uni/lex_utf8.t
+++ b/t/uni/lex_utf8.t
@@ -8,13 +8,13 @@ BEGIN {
     chdir 't';
     @INC = '../lib';
     require './test.pl';
-    skip_all_if_miniperl("no dynamic loading on miniperl, no re");
+    skip_all_without_unicode_tables();
     skip_all('EBCDIC') if $::IS_EBCDIC;
 }
 
 use strict;
 
-plan (tests => 15);
+plan (tests => 16);
 use charnames ':full';
 
 use utf8;
@@ -61,5 +61,10 @@ eval 'tr νaνbν';
 is $@, "", 'y/// compiles, where / is actually a wide character';
 is $_, "b", 'transliteration worked';
 
+use constant foofoo=>qq|\xc4\xb5|;
+{ no strict; ()=${"\xc4\xb5::foo"} } # vivify ĵ package
+eval 'my foofoo $dog'; # foofoo was resolving to ĵ, not ĵ
+is $@, '', 'my constant $var in utf8 scope where constant is not utf8';
+
 __END__
 
diff --git a/toke.c b/toke.c
index 4d33472..b98fe6f 100644
--- a/toke.c
+++ b/toke.c
@@ -4128,7 +4128,7 @@ S_find_in_my_stash(pTHX_ const char *pkgname, STRLEN len)
     if (gv && GvCV(gv)) {
        SV * const sv = cv_const_sv(GvCV(gv));
        if (sv)
-            pkgname = SvPV_const(sv, len);
+           return gv_stashsv(sv, 0);
     }
 
     return gv_stashpvn(pkgname, len, UTF ? SVf_UTF8 : 0);

--
Perl5 Master Repository

Reply via email to