The SVs in the names AV have their PV being the name of the variable.
NV+1..IV inclusive is a range of cop_seq numbers for which the name is
valid. For typed lexicals name SV is SVt_PVMG and SvSTASH points at the
-type. For C<our> lexicals, the type is also SVt_PVGV, with the MAGIC slot
+type. For C<our> lexicals, the type is also SVt_PVMG, with the OURSTASH slot
pointing at the stash of the associated global (so that duplicate C<our>
declarations in the same package can be detected). SvCUR is sometimes
hijacked to store the generation number during compilation.
sv_setpv(namesv, name);
if (typestash) {
+ assert(SvTYPE(namesv) == SVt_PVMG);
SvPAD_TYPED_on(namesv);
SvSTASH_set(namesv, (HV*)SvREFCNT_inc_simple_NN((SV*)typestash));
}
}
if (type >= SVt_PVMG) {
if ((type == SVt_PVMG || type == SVt_PVGV) && SvPAD_OUR(sv)) {
+ assert(type != SVt_PVGV);
SvREFCNT_dec(OURSTASH(sv));
} else if (SvMAGIC(sv))
mg_free(sv);