for instance, when it has been deleted
*/
if ( isGV_with_GP(CvGV(coderef)) ) {
- GV *gv = CvGV(coderef);
- *pkg = HvNAME( GvSTASH(gv) ? GvSTASH(gv) : CvSTASH(coderef) );
- *name = GvNAME( CvGV(coderef) );
+ GV *gv = CvGV(coderef);
+ HV *stash = GvSTASH(gv) ? GvSTASH(gv) : CvSTASH(coderef);
+
+ *pkg = stash ? HvNAME(stash) : "__UNKNOWN__";
+ *name = GvNAME( CvGV(coderef) );
} else {
- *pkg = "__UNKNOWN__";
- *name = "__ANON__";
+ *pkg = "__UNKNOWN__";
+ *name = "__ANON__";
}
return 1;