SvREFCNT_dec(sv);
SvREFCNT_dec(value);
break;
+ case SAVEt_GVSLOT: /* any slot in GV */
+ value = MUTABLE_SV(SSPOPPTR);
+ ptr = SSPOPPTR;
+ gv = MUTABLE_GV(SSPOPPTR);
+ hv = GvSTASH(gv);
+ if (hv && HvENAME(hv) && (
+ (value && SvTYPE(value) == SVt_PVCV)
+ || (*(SV **)ptr && SvTYPE(*(SV**)ptr) == SVt_PVCV)
+ ))
+ {
+ if ((char *)ptr < (char *)GvGP(gv)
+ || (char *)ptr > (char *)GvGP(gv) + sizeof(struct gp)
+ || GvREFCNT(gv) > 1)
+ PL_sub_generation++;
+ else mro_method_changed_in(hv);
+ }
+ goto restore_svp;
case SAVEt_AV: /* array reference */
av = MUTABLE_AV(SSPOPPTR);
gv = MUTABLE_GV(SSPOPPTR);
GvCVGEN(dstr) = 0; /* Switch off cacheness. */
}
}
- SAVEGENERICSV(*location);
+ /* SAVEt_GVSLOT takes more room on the savestack and has more
+ overhead in leave_scope than SAVEt_GENERIC_SV. But for CVs
+ leave_scope needs access to the GV so it can reset method
+ caches. We must use SAVEt_GVSLOT whenever the type is
+ SVt_PVCV, even if the stash is anonymous, as the stash may
+ gain a name somehow before leave_scope. */
+ if (stype == SVt_PVCV) {
+ /* There is no save_pushptrptrptr. Creating it for this
+ one call site would be overkill. So inline the ss push
+ routines here. */
+ SSCHECK(4);
+ SSPUSHPTR(dstr);
+ SSPUSHPTR(location);
+ SSPUSHPTR(SvREFCNT_inc(*location));
+ SSPUSHUV(SAVEt_GVSLOT);
+ }
+ else SAVEGENERICSV(*location);
}
dref = *location;
if (stype == SVt_PVCV && (*location != sref || GvCVGEN(dstr))) {
ptr = POPPTR(ss,ix);
TOPPTR(nss,ix) = svp_dup_inc((SV**)ptr, proto_perl);/* XXXXX */
break;
+ case SAVEt_GVSLOT: /* any slot in GV */
+ sv = (const SV *)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = sv_dup_inc(sv, param);
+ ptr = POPPTR(ss,ix);
+ TOPPTR(nss,ix) = svp_dup_inc((SV**)ptr, proto_perl);/* XXXXX */
+ sv = (const SV *)POPPTR(ss,ix);
+ TOPPTR(nss,ix) = sv_dup_inc(sv, param);
+ break;
case SAVEt_HV: /* hash reference */
case SAVEt_AV: /* array reference */
sv = (const SV *) POPPTR(ss,ix);
sub { is(MCTest::Derived->foo(0), 5); },
sub { { local *MCTest::Base::can = sub { "tomatoes" };
MCTest::Derived->can(0); }
- local $::TODO = " ";
is(MCTest::Derived->can("isa"), \&UNIVERSAL::isa,
'removing method when unwinding local *method=sub{}'); },
sub { sub peas { "peas" }