if (!padlist)
return;
- if (!SvREFCNT(CvPADLIST(cv))) /* may be during global destruction */
+ if (SvIS_FREED(padlist)) /* may be during global destruction */
return;
DEBUG_X(PerlIO_printf(Perl_debug_log,
/* XXX DAPM integrate alloc(), add_name() and add_anon(),
* or at least rationalise ??? */
-
+/* And flag whether the incoming name is UTF8 or 8 bit?
+ Could do this either with the +ve/-ve hack of the HV code, or expanding
+ the flag bits. Either way, this makes proper Unicode safe pad support.
+ Also could change the sv structure to make the NV a union with 2 U32s,
+ so that SvCUR() could stop being overloaded in pad SVs.
+ NWC
+*/
PADOFFSET
Perl_pad_alloc(pTHX_ I32 optype, U32 tmptype)
retval = AvFILLp(PL_comppad);
}
else {
- SV ** const names = AvARRAY(PL_comppad_name);
+ SV * const * const names = AvARRAY(PL_comppad_name);
const SSize_t names_fill = AvFILLp(PL_comppad_name);
for (;;) {
/*
nameav = (AV*)AvARRAY(CvPADLIST(PL_compcv))[0];
name_svp = AvARRAY(nameav);
for (offset = AvFILLp(nameav); offset > 0; offset--) {
- const SV *namesv = name_svp[offset];
+ const SV * const namesv = name_svp[offset];
if (namesv && namesv != &PL_sv_undef
&& !SvFAKE(namesv)
&& (SvFLAGS(namesv) & SVpad_OUR)
if (padlist) { /* not an undef CV */
I32 fake_offset = 0;
- const AV *nameav = (AV*)AvARRAY(padlist)[0];
- SV **name_svp = AvARRAY(nameav);
+ const AV * const nameav = (AV*)AvARRAY(padlist)[0];
+ SV * const * const name_svp = AvARRAY(nameav);
for (offset = AvFILLp(nameav); offset > 0; offset--) {
- const SV *namesv = name_svp[offset];
+ const SV * const namesv = name_svp[offset];
if (namesv && namesv != &PL_sv_undef
&& strEQ(SvPVX_const(namesv), name))
{
Perl_pad_leavemy(pTHX)
{
I32 off;
- SV ** const svp = AvARRAY(PL_comppad_name);
+ SV * const * const svp = AvARRAY(PL_comppad_name);
PL_pad_reset_pending = FALSE;
av_store(PL_comppad_name, AvFILLp(PL_comppad), Nullsv);
if (type == padtidy_SUBCLONE) {
- SV ** const namep = AvARRAY(PL_comppad_name);
+ SV * const * const namep = AvARRAY(PL_comppad_name);
PADOFFSET ix;
for (ix = AvFILLp(PL_comppad); ix > 0; ix--) {
* so try to grab the current const value, and if successful,
* turn into a const sub:
*/
- SV* const_sv = op_const_sv(CvSTART(cv), cv);
+ SV* const const_sv = op_const_sv(CvSTART(cv), cv);
if (const_sv) {
SvREFCNT_dec(cv);
cv = newCONSTSUB(CvSTASH(proto), Nullch, const_sv);
SV ** const namepad = AvARRAY(comppad_name);
SV ** const curpad = AvARRAY(comppad);
for (ix = AvFILLp(comppad_name); ix > 0; ix--) {
- const SV *namesv = namepad[ix];
+ const SV * const namesv = namepad[ix];
if (namesv && namesv != &PL_sv_undef
&& *SvPVX_const(namesv) == '&')
{
}
else {
/* save temporaries on recursion? */
- SV *sv = NEWSV(0, 0);
+ SV * const sv = NEWSV(0, 0);
av_store(newpad, ix, sv);
SvPADTMP_on(sv);
}
HV *
Perl_pad_compname_type(pTHX_ const PADOFFSET po)
{
- SV** const av = av_fetch(PL_comppad_name, po, FALSE);
+ SV* const * const av = av_fetch(PL_comppad_name, po, FALSE);
if ( SvFLAGS(*av) & SVpad_TYPED ) {
return SvSTASH(*av);
}