}
if (ourstash) {
SvFLAGS(namesv) |= SVpad_OUR;
- GvSTASH(namesv) = (HV*)SvREFCNT_inc((SV*) ourstash);
+ GvSTASH(namesv) = ourstash;
+ Perl_sv_add_backref(aTHX_ (SV*)ourstash, namesv);
}
av_store(PL_comppad_name, offset, namesv);
if (refadjust)
SvREFCNT_dec(PL_curpad[po]);
+
+ /* if pad tmps aren't shared between ops, then there's no need to
+ * create a new tmp when an existing op is freed */
+#ifdef USE_BROKEN_PAD_RESET
PL_curpad[po] = NEWSV(1107,0);
SvPADTMP_on(PL_curpad[po]);
+#else
+ PL_curpad[po] = &PL_sv_undef;
+#endif
if ((I32)po < PL_padix)
PL_padix = po - 1;
}