=cut
*/
-/* Macro to avoid repeating the code three times. */
+/* Macro to avoid repeating the code five times. */
#define CLEAR_LINEAR(mEta) \
if (mEta->mro_linear_all) { \
SvREFCNT_dec(MUTABLE_SV(mEta->mro_linear_all)); \
as neither B nor B::B can be updated before the other, since they
will reset caches on foo, which will see either B or B::B with the
wrong name. The names must be set on *all* affected stashes before
- we do anything else.
+ we do anything else. (And linearisations must be cleared, too.)
*/
stashes = (HV *) sv_2mortal((SV *)newHV());
mro_gather_and_rename(
stash, oldstash, newname, newname_len
);
- /* Iterate through the stashes, wiping isa linearisations, but leaving
- the isa hash (which mro_isa_changed_in needs for adjusting the
- isarev hashes belonging to parent classes). */
- hv_iterinit(stashes);
- while((iter = hv_iternext(stashes))) {
- HV * const stash = *(HV **)HEK_KEY(HeKEY_hek(iter));
- if(HvENAME(stash)) {
- struct mro_meta* meta;
- meta = HvMROMETA(stash);
- CLEAR_LINEAR(meta);
- }
- }
-
/* Once the caches have been wiped on all the classes, call
mro_isa_changed_in on each. */
hv_iterinit(stashes);
: &PL_sv_yes,
0
);
+ CLEAR_LINEAR(meta);
/* Update the effective name. */
if(HvENAME_get(oldstash)) {
: &PL_sv_yes,
0
);
+ CLEAR_LINEAR(meta);
}
}
}
: &PL_sv_yes,
0
);
+ CLEAR_LINEAR(meta);
}
}