we hit it without the guard, we segfault. The slightly odd return
value strikes me as an improvement (mst)
*/
-#ifdef isGV_with_GP
+
if ( isGV_with_GP(CvGV(coderef)) ) {
-#endif
- *pkg = HvNAME( GvSTASH(CvGV(coderef)) );
+ GV *gv = CvGV(coderef);
+ *pkg = HvNAME( GvSTASH(gv) ? GvSTASH(gv) : CvSTASH(coderef) );
*name = GvNAME( CvGV(coderef) );
-#ifdef isGV_with_GP
} else {
*pkg = "__UNKNOWN__";
*name = "__ANON__";
}
-#endif
return 1;
}
but that's the API */
key = HePV(he, keylen);
package = HvNAME(stash);
- fq = newSVpvf("%s::%s", package, key);
+ fq = sv_2mortal(newSVpvf("%s::%s", package, key));
sv = (SV *)get_cv(SvPV_nolen(fq), 0);
break;
}