diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-11-02 06:17:23 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-11-02 06:17:23 -0700 |
commit | 8bfda0d7d50f05de298abca907611be9a33d1626 (patch) | |
tree | 77cd1dc3647bb32094a31eda4b721dcd10938c1b /gv.c | |
parent | caa674f3cc1c9e05da7c41f3dffbea4b2640af3c (diff) | |
download | perl-8bfda0d7d50f05de298abca907611be9a33d1626.tar.gz |
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.
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1057,7 +1057,7 @@ Perl_gv_fetchmethod_pvn_flags(pTHX_ HV *stash, const char *name, const STRLEN le GV* stubgv; GV* autogv; - if (CvANON(cv)) + if (CvANON(cv) || !CvGV(cv)) stubgv = gv; else { stubgv = CvGV(cv); |