diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-10-30 18:37:41 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-10-30 18:37:41 +0000 |
commit | 93fec93b7d98eb18b84317351ccfa1bbd271ec21 (patch) | |
tree | ecac29d964bda7063b5ad6c760e482c1597871db /ext/Devel | |
parent | edb113cf5f89b7f57ad122b3821a9cf42cf08880 (diff) | |
download | perl-93fec93b7d98eb18b84317351ccfa1bbd271ec21.tar.gz |
Avoid Devel::DProf failing an assertion during global destruction.
p4raw-id: //depot/perl@29165
Diffstat (limited to 'ext/Devel')
-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); |