In perl.git, the branch maint-5.20 has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/415f56224a2c6b2810cedd5c478fa5969e7091eb?hp=7018e207a4aba9fdbe423ecf0c2dcf49b5ad2eb7>

- Log -----------------------------------------------------------------
commit 415f56224a2c6b2810cedd5c478fa5969e7091eb
Author: Matthew Horsfall <[email protected]>
Date:   Fri Aug 21 17:21:10 2015 +0100

    perldelta for d2fcb1d677
    
    (manually cherry picked from commit 
80e86009a1ba918b82ab94a400855d0168801db3)

M       pod/perldelta.pod

commit 913281cacd3442109f345cc20d38e78a36470f94
Author: Father Chrysostomos <[email protected]>
Date:   Mon Jul 20 11:23:49 2015 -0700

    [perl #125541] Fix crash with %::=(); J->${\"::"}
    
    gv_stashpvn does not expect gv_fetchpv to return something that is
    not a GV.  If someone has blown away the stash with %::=(), then the
    $::{"main::"} entry no longer exists, but gv_fetchpv expects it to be
    there.  This patch just makes this case fail somewhat gracefully
    instead of crashing:
    
    $  ./miniperl -e '%::=(); J->${\"::"}'
    Can't locate object method "" via package "" (perhaps you forgot to load 
""?) at -e line 1.
    
    If someone does %::=(), nothing more reasonable should be expected.
    At least it does not crash now.
    
    (cherry picked from commit d2fcb1d6773910aef058d59681ff6ae649f68352)

M       gv.c
-----------------------------------------------------------------------

Summary of changes:
 gv.c              | 2 +-
 pod/perldelta.pod | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gv.c b/gv.c
index ce68478..6b17ae2 100644
--- a/gv.c
+++ b/gv.c
@@ -1339,7 +1339,7 @@ Perl_gv_stashpvn(pTHX_ const char *name, U32 namelen, I32 
flags)
     tmpgv = gv_fetchpvn_flags(tmpbuf, tmplen, flags, SVt_PVHV);
     if (tmpbuf != smallbuf)
        Safefree(tmpbuf);
-    if (!tmpgv)
+    if (!tmpgv || !isGV_with_GP(tmpgv))
        return NULL;
     stash = GvHV(tmpgv);
     if (!(flags & ~GV_NOADD_MASK) && !stash) return NULL;
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 1334a24..83d76a4 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -216,6 +216,11 @@ L<[perl 
#123398]|https://rt.perl.org/Ticket/Display.html?id=123398>
 C<setpgrp($nonzero)> (with one argument) was accidentally changed in Perl 5.16
 to mean C<setpgrp(0)>.  This has been fixed.
 
+=item *
+
+A crash with C<< %::=(); J->${\"::"} >> has been fixed.
+L<[perl #125541]|https://rt.perl.org/Ticket/Display.html?id=125541>
+
 =back
 
 =head1 Acknowledgements

--
Perl5 Master Repository

Reply via email to