AvARRAY(PL_comppad), PL_curpad);
if (PL_pad_reset_pending)
pad_reset();
- if (tmptype & SVs_PADMY) {
+ if (tmptype == SVs_PADMY) { /* Not & because this ‘flag’ is 0. */
/* For a my, simply push a null SV onto the end of PL_comppad. */
sv = *av_fetch(PL_comppad, AvFILLp(PL_comppad) + 1, TRUE);
retval = AvFILLp(PL_comppad);
sv = *av_fetch(PL_comppad, retval, TRUE);
if (!(SvFLAGS(sv) &
#ifdef USE_PAD_RESET
- (SVs_PADMY|(konst ? SVs_PADTMP : 0))
+ (konst ? SVs_PADTMP : 0))
#else
- (SVs_PADMY|SVs_PADTMP)
+ SVs_PADTMP
#endif
))
break;
assert (SvTYPE(func) == SVt_PVFM);
av_store(PL_comppad, ix, rv);
}
- SvPADMY_on((SV*)func);
/* to avoid ref loops, we never have parent + child referencing each
* other simultaneously */
sv = MUTABLE_SV(newHV());
else
sv = newSV(0);
- SvPADMY_on(sv);
/* reset the 'assign only once' flag on each state var */
if (sigil != '&' && SvPAD_STATE(namesv))
SvPADSTALE_on(sv);
to it and it will be returned. Otherwise the returned SV will be a new
mortal.
+If the I<flags> include CV_NAME_NOTQUAL, then the package name will not be
+included. If the first argument is neither a CV nor a GV, this flag is
+ignored (subject to change).
+
=cut
*/
SV *
-Perl_cv_name(pTHX_ CV *cv, SV *sv)
+Perl_cv_name(pTHX_ CV *cv, SV *sv, U32 flags)
{
PERL_ARGS_ASSERT_CV_NAME;
if (!isGV_with_GP(cv) && SvTYPE(cv) != SVt_PVCV) {
SV * const retsv = sv ? (sv) : sv_newmortal();
if (SvTYPE(cv) == SVt_PVCV) {
if (CvNAMED(cv)) {
- if (CvLEXICAL(cv)) sv_sethek(retsv, CvNAME_HEK(cv));
+ if (CvLEXICAL(cv) || flags & CV_NAME_NOTQUAL)
+ sv_sethek(retsv, CvNAME_HEK(cv));
else {
sv_sethek(retsv, HvNAME_HEK(CvSTASH(cv)));
sv_catpvs(retsv, "::");
sv_cathek(retsv, CvNAME_HEK(cv));
}
}
- else if (CvLEXICAL(cv))
+ else if (CvLEXICAL(cv) || flags & CV_NAME_NOTQUAL)
sv_sethek(retsv, GvNAME_HEK(GvEGV(CvGV(cv))));
else gv_efullname3(retsv, CvGV(cv), NULL);
}
+ else if (flags & CV_NAME_NOTQUAL) sv_sethek(retsv, GvNAME_HEK(cv));
else gv_efullname3(retsv,(GV *)cv,NULL);
return retsv;
}
else if (sigil == '%')
sv = MUTABLE_SV(newHV());
else
+ {
sv = newSV(0);
+ /* For flip-flop targets: */
+ if (oldpad[ix] && SvPADTMP(oldpad[ix]))
+ SvPADTMP_on(sv);
+ }
av_store(newpad, ix, sv);
- SvPADMY_on(sv);
}
}
else if (PadnamePV(names[ix])) {
else
sv = newSV(0);
pad1a[ix] = sv;
- SvPADMY_on(sv);
}
}
}
/* SvREFCNT(oldpad[ix]) != 1 for some code in threads.xs
FIXTHAT before merging this branch.
(And I know how to) */
- if (SvPADMY(oldpad[ix]))
- SvPADMY_on(sv);
- else
+ if (SvPADTMP(oldpad[ix]))
SvPADTMP_on(sv);
}
}