In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/361e750a9a6d18a3c0a16e6334f990d06078e604?hp=8b4c5ad11955dc809ba3b7d6672b3a13ea54e770>

- Log -----------------------------------------------------------------
commit 361e750a9a6d18a3c0a16e6334f990d06078e604
Author: Father Chrysostomos <[email protected]>
Date:   Sat Sep 13 12:54:07 2014 -0700

    Obsolete comment in sv.c:utf8_mg_pos_cache_update
    
    ab8be49d3 added this comment and the SvPOKp check.  Half the comment
    is not relevant any more, since we stopped caching UTF8 offsets on
    references in commit d91e94e1ac8.  The SvPOKp check is still a good
    idea, though.
    
    $ perl5.14.4 -e 'use overload q|""| => sub { "\x{100}" }; $_ = bless[]; $__ 
= substr $_,0,1; use Devel::Peek; Dump $_'
    SV = PVMG(0x7fb2f2856738) at 0x7fb2f283a348
      REFCNT = 1
      FLAGS = (SMG,ROK,UTF8)
      IV = 0
      NV = 0
      RV = 0x7fb2f2806d00
      SV = PVAV(0x7fb2f2807ec0) at 0x7fb2f2806d00
        REFCNT = 1
        FLAGS = (OBJECT,OVERLOAD)
        STASH = 0x7fb2f2806b68  "main"
        ARRAY = 0x0
        FILL = -1
        MAX = -1
        ARYLEN = 0x0
        FLAGS = (REAL)
      PV = 0x7fb2f2806d00 "" [UTF8 ""]
      CUR = 0
      LEN = 0
      MAGIC = 0x7fb2f240f708
        MG_VIRTUAL = &PL_vtbl_utf8
        MG_TYPE = PERL_MAGIC_utf8(w)
        MG_LEN = 1
    $ perl5.18.1 -e 'use overload q|""| => sub { "\x{100}" }; $_ = bless[]; $__ 
= substr $_,0,1; use Devel::Peek; Dump $_'
    SV = IV(0x7fc048837c40) at 0x7fc048837c50
      REFCNT = 1
      FLAGS = (ROK,UTF8)
      RV = 0x7fc0488060e8
      SV = PVAV(0x7fc048807e80) at 0x7fc0488060e8
        REFCNT = 1
        FLAGS = (OBJECT)
        STASH = 0x7fc048805f50  "main"
        ARRAY = 0x0
        FILL = -1
        MAX = -1
        ARYLEN = 0x0
        FLAGS = (REAL)
-----------------------------------------------------------------------

Summary of changes:
 sv.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/sv.c b/sv.c
index 7791067..8b84680 100644
--- a/sv.c
+++ b/sv.c
@@ -7283,12 +7283,9 @@ S_utf8_mg_pos_cache_update(pTHX_ SV *const sv, MAGIC 
**const mgp, const STRLEN b
     assert(cache);
 
     if (PL_utf8cache < 0 && SvPOKp(sv)) {
-       /* SvPOKp() because it's possible that sv has string overloading, and
-          therefore is a reference, hence SvPVX() is actually a pointer.
-          This cures the (very real) symptoms of RT 69422, but I'm not actually
-          sure whether we should even be caching the results of UTF-8
-          operations on overloading, given that nothing stops overloading
-          returning a different value every time it's called.  */
+       /* SvPOKp() because, if sv is a reference, then SvPVX() is actually
+          a pointer.  Note that we no longer cache utf8 offsets on refer-
+          ences, but this check is still a good idea, for robustness.  */
        const U8 *start = (const U8 *) SvPVX_const(sv);
        const STRLEN realutf8 = utf8_length(start, start + byte);
 

--
Perl5 Master Repository

Reply via email to