• Father Chrysostomos's avatar
    Fix crash with %::=(); J->${\"::"} · 2a87f87c
    Father Chrysostomos authored
    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)
    
    Bug: https://rt.perl.org/Ticket/Display.html?id=125541
    Bug-Debian: https://bugs.debian.org/822336
    Patch-Name: fixes/5.20.3/stashpvn_crash.diff
    2a87f87c