The code in pp_ctl.c after calling an @INC hook blindly assumes that the
SV setted by the user in %INC is an SVPV (SvPOK true) for setting the
filename. So when the user uses other scalar types, the output of
__FILE__, warn, die, caller, etc. shows random garbage.
/* Adjust file name if the hook has set an %INC entry */
svp = hv_fetch(GvHVn(PL_incgv), name, len, 0);
if (svp)
- tryname = SvPVX_const(*svp);
+ tryname = SvPV_nolen_const(*svp);
if (count > 0) {
int i = 0;