If a subroutine stub exists and a new subroutine is defined with the
same name, that new subroutine’s body is attached to the stub. So
there are no changes from the point of view of method lookup.
For most subs, mro_method_changed_in is not called in this case.
For constant subs, it was being called.
In the case where a new sub is being created, we know that
cv == GvCV(gv) and GvSTASH(gv) is set, so checking CvSTASH is
unnecessary.
}
}
if (const_sv) {
- HV *stash;
SvREFCNT_inc_simple_void_NN(const_sv);
if (cv) {
assert(!CvROOT(cv) && !CvCONST(cv));
NULL, name, namlen, name_is_utf8 ? SVf_UTF8 : 0,
const_sv
);
- }
- stash =
- (CvGV(cv) && GvSTASH(CvGV(cv)))
- ? GvSTASH(CvGV(cv))
- : CvSTASH(cv)
- ? CvSTASH(cv)
- : PL_curstash;
- if (HvENAME_HEK(stash))
- mro_method_changed_in(stash); /* sub Foo::Bar () { 123 } */
+ if (HvENAME_HEK(GvSTASH(gv)))
+ /* sub Foo::bar { (shift)+1 } */
+ mro_method_changed_in(GvSTASH(gv));
+ } /* sub Foo::Bar () { 123 } */
if (PL_madskills)
goto install_block;
op_free(block);