diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-08-21 22:11:47 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-08-21 22:11:47 +0100 |
commit | 9c1314f0ea4d104e361a6e4ededa781e65b14518 (patch) | |
tree | 7de2fab0899f2f0f71f50bc8911dae340855ab8a /ext/mro | |
parent | 8e234d892cf814aba4e038461a11d692e092aa71 (diff) | |
download | perl-9c1314f0ea4d104e361a6e4ededa781e65b14518.tar.gz |
gv_efullname3() could return NULL, so mro::_nextcan() must cope (and croak()).
Diffstat (limited to 'ext/mro')
-rw-r--r-- | ext/mro/mro.xs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/mro/mro.xs b/ext/mro/mro.xs index f8a1ee7b5a..69557a67d7 100644 --- a/ext/mro/mro.xs +++ b/ext/mro/mro.xs @@ -537,10 +537,15 @@ mro__nextcan(...) gv_efullname3(sv, cvgv, NULL); - fq_subname = SvPVX(sv); - fq_subname_len = SvCUR(sv); + if(SvPOK(sv)) { + fq_subname = SvPVX(sv); + fq_subname_len = SvCUR(sv); + + subname = strrchr(fq_subname, ':'); + } else { + subname = NULL; + } - subname = strrchr(fq_subname, ':'); if(!subname) Perl_croak(aTHX_ "next::method/next::can/maybe::next::method cannot find enclosing method"); |