diff options
Diffstat (limited to 'ext/Devel/DProf')
-rw-r--r-- | ext/Devel/DProf/DProf.xs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/Devel/DProf/DProf.xs b/ext/Devel/DProf/DProf.xs index 6ce8e5254a..57e0084bd7 100644 --- a/ext/Devel/DProf/DProf.xs +++ b/ext/Devel/DProf/DProf.xs @@ -370,9 +370,13 @@ prof_mark(pTHX_ opcode ptype) CV * const cv = db_get_cv(aTHX_ Sub); GV * const gv = CvGV(cv); - pname = GvSTASH(gv) ? HvNAME_get(GvSTASH(gv)) : NULL; - pname = pname ? pname : (char *) "(null)"; - gname = GvNAME(gv); + if (isGV_with_GP(gv)) { + pname = GvSTASH(gv) ? HvNAME_get(GvSTASH(gv)) : NULL; + pname = pname ? pname : (char *) "(null)"; + gname = GvNAME(gv); + } else { + gname = pname = (char *) "(null)"; + } set_cv_key(aTHX_ cv, pname, gname); svp = hv_fetch(g_cv_hash, SvPVX_const(g_key_hash), SvCUR(g_key_hash), TRUE); |