From: Nicholas Clark Date: Fri, 21 Aug 2009 21:11:47 +0000 (+0100) Subject: gv_efullname3() could return NULL, so mro::_nextcan() must cope (and croak()). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9c1314f0ea4d104e361a6e4ededa781e65b14518;p=p5sagit%2Fp5-mst-13.2.git gv_efullname3() could return NULL, so mro::_nextcan() must cope (and croak()). --- diff --git a/ext/mro/mro.xs b/ext/mro/mro.xs index f8a1ee7..69557a6 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");