Undefined lex sub used as inherited method crashes
authorFather Chrysostomos <sprout@cpan.org>
Sat, 2 Nov 2013 13:17:23 +0000 (06:17 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 2 Nov 2013 13:17:23 +0000 (06:17 -0700)
commit8bfda0d7d50f05de298abca907611be9a33d1626
tree77cd1dc3647bb32094a31eda4b721dcd10938c1b
parentcaa674f3cc1c9e05da7c41f3dffbea4b2640af3c
Undefined lex sub used as inherited method crashes

Thanks to misuse of CvGV.

$ perl5.19.5 -XMfeature=:all -e 'my sub foo {} undef &foo; *UNIVERSAL::bar = \&foo; main->bar()'
Segmentation fault: 11

When deciding under which name to autoload the sub, we can’t assume
CvGV(that_sub) is a GV, as it may be null.
gv.c
t/op/lexsub.t