This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(perl #134072) allow \&foo = \&bar to work in main::
authorTony Cook <tony@develop-help.com>
Wed, 15 May 2019 05:59:49 +0000 (15:59 +1000)
committerTony Cook <tony@develop-help.com>
Wed, 12 Jun 2019 01:52:08 +0000 (11:52 +1000)
commit40258daf9899686d934c460ba3630431312d7694
treec2d170b2f74d85ceb5b801c2ad0b4f699c5c1b24
parent5b2f1ba66ef295d86085d8099d6c8cf1943913e9
(perl #134072) allow \&foo = \&bar to work in main::

subs in main:: are stored as a RV referring to a CV as a space
optimization, but the pp_refassign code expected to find a glob,
which made the assignment a no-op.

Fix this by upgrading the reference to a glob in the refassign check
function.

Note that this would be an issue in other packages if 1e2cfe157ca
was reverted (allowing the space savings in other packages too.)
op.c
t/op/lvref.t