This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[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.