This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #131085] Crash with sub-in-stash
authorFather Chrysostomos <sprout@cpan.org>
Fri, 7 Apr 2017 21:08:02 +0000 (14:08 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 1 Jun 2017 13:34:59 +0000 (06:34 -0700)
commit790acddeaa0d2c73524596048b129561225cf100
tree3262a6dd2a3b07b34e1440b3c48cf0bceaf8b43b
parentdddb22758b5060ae9de978fbb03317185af97b24
[perl #131085] Crash with sub-in-stash

$ perl -e '$::{"A"} = sub {}; \&{"A"}'
Segmentation fault (core dumped)

The code that vivifies a typeglob out of a code ref assumed that the
CV had a name hek, which is always the case when perl itself puts the
code ref there (via ‘sub A{}’), but is not necessarily the case if
someone is insinuating other stuff into the stash.
gv.c
t/op/gv.t